First off, thanks for coding this amazing piece of software, Henrik.
I'm trying to do a http content check of my Netgear print server's web interface. The print server has two ports, and I'd like to have two separate columns that show the status of the two printer ports. I've tried to come up with some regular expressions, but they haven't worked so far.
Here's a snippet of the HTML: --------- HTML START ---------- <table width="530" height="230" border="0" cellpadding="0" cellspacing=0 bgcolor="#ffbe39"> <div class="maintab"> <tr>
<td> </TD> <th nowrap align="left">Parallel Port 1<p></th> <th nowrap align="left">Parallel Port 2<p></th> </tr>
<tr><td nowrap> Port Name</td> <td nowrap>P1</td> <td nowrap>P2</td>
</tr> <tr><td nowrap> Status</td> <td nowrap>On-Line</td> <td nowrap>Offline</td>
</tr> <tr><td nowrap> Print State</td>
<td nowrap>Idle</td> <td nowrap>Idle</td> --------- HTML END ----------
I'd like the column color to change if the status of the corresponding printer port does not match the string "On-Line". In this case, I'd prefer if the columns went clear instead of red. I've tried prefixing "cont" with a question mark, but this doesn't work. I'm running 4.2.0. Why is that?
I'm hoping you can help me create a regex that will do what I've described.
M. Hansen schrieb:
First off, thanks for coding this amazing piece of software, Henrik.
I'm trying to do a http content check of my Netgear print server's web interface. The print server has two ports, and I'd like to have two separate columns that show the status of the two printer ports. I've tried to come up with some regular expressions, but they haven't worked so far.
I'd write a small extension script, which first runs your web page through 'w3m -dump' and then scans in in the resulting text file for your printer lines to send am message to the xymon server
mfg
Andreas Kunberger
-- DITF
On Thu, Nov 19, 2009 at 8:44 AM, Andreas Kunberger <andreas.kunberger at itv-denkendorf.de> wrote:
I'd write a small extension script, which first runs your web page through 'w3m -dump' and then scans in in the resulting text file for your printer lines to send am message to the xymon server
Good idea, but I assume I would have to run the extension script on a box running hobbitclient? The print server is a small embedded device (Netgear PS110), so there's no way I would be able run the extension script locally on the print server. Is it possible to run the script on another box and have the results show up as if they came from the print server?
Are you sure it's not possible to just make two different cont tests? My knowledge of regular expressions is quite limited, but I assumed it would be trivial to match those strings.
Also, does the cont check parse the raw HTML data or just the text stripped of HTML? I mean, do I have to write a regex like...
On-Line</td>\n\n</tr> (needs escape characters, I know)
...or...
On-Line\s*$
...in order to match the status of the second port?
Thanks!
I have dozens of scripts which run on my hobbit server (using its MIPs, memory, etc.) which report on things all over the network and report them as coming from the hosts being monitored. Just make sure the $MACHINE in the "bb" status command is the monitored host, not the machine running the script.
.....Bruce
Bruce White Senior Enterprise Systems Engineer | Phone: 630-671-5169 | Fax: 630-893-1648 | bewhite at fellowes.com | http://www.fellowes.com/
Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Fellowes, Inc.
-----Original Message----- From: M. Hansen [mailto:mh31337 at gmail.com] Sent: Thursday, November 19, 2009 8:55 AM To: hobbit at hswn.dk Subject: Re: [hobbit] cont regex
On Thu, Nov 19, 2009 at 8:44 AM, Andreas Kunberger <andreas.kunberger at itv-denkendorf.de> wrote:
I'd write a small extension script, which first runs your web page through 'w3m -dump' and then scans in in the resulting text file for your printer lines to
send am message to the xymon server
Good idea, but I assume I would have to run the extension script on a box running hobbitclient? The print server is a small embedded device (Netgear PS110), so there's no way I would be able run the extension script locally on the print server. Is it possible to run the script on another box and have the results show up as if they came from the print server?
Are you sure it's not possible to just make two different cont tests? My knowledge of regular expressions is quite limited, but I assumed it would be trivial to match those strings.
Also, does the cont check parse the raw HTML data or just the text stripped of HTML? I mean, do I have to write a regex like...
On-Line</td>\n\n</tr> (needs escape characters, I know)
...or...
On-Line\s*$
...in order to match the status of the second port?
Thanks!
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
participants (3)
-
andreas.kunberger@itv-denkendorf.de
-
bewhite@fellowes.com
-
mh31337@gmail.com