Xymon Mailing List Archive search

cont check regex problems

4 messages in this thread

list Kimberly McKinnis · Tue, 26 Aug 2008 16:25:06 -0700 ·
I'm not clear what I'm doing wrong in my cont check in bb-hosts, and I
was hoping someone could help me out. My regular expression works fine
in perl: perl -e '$text = join "", <>; if ($text =~
/assetID="[0-9A-Fa-f]{8}"/) { print "OK\n"; } else { print "NotOK\n"; }'
< /tmp/vodbrowser.php

 
However, bb-hosts line fails on the regex check: 10.100.104.53
seachange-vod   # testip
cont=vod;http://mrteeny/vod/vodbrowser.php;assetID="[0-9A-Fa-f]{8}";

 
It *is* a webpage I'm trying to match... so the page starts with:

<html>
<head>
<title>VOD Interface</title>
</head>
<body bgcolor=white>
<h3 align=center>Vod Interface</h3>
<pre>
assetID="00080002"

 
However, I really only care if the assetID is being displayed.  Any
suggestions?
list Kimberly McKinnis · Tue, 26 Aug 2008 16:38:37 -0700 ·
Hmm. Hobbit seems to have not liked the digit range. 

Using assetID="[0-9abcdefABCDEF]{8}" is working. I'm not clear *why*
Hobbit didn't like my digit range when perl did, and I'm curious to
figure it out, but for now I'm happy that my check works. 
quoted from Kimberly McKinnis

 
From: Kimberly McKinnis [mailto:user-9a37612a7e34@xymon.invalid] 
Sent: Tuesday, August 26, 2008 4:25 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] cont check regex problems

 
I'm not clear what I'm doing wrong in my cont check in bb-hosts, and I
was hoping someone could help me out. My regular expression works fine
in perl: perl -e '$text = join "", <>; if ($text =~
/assetID="[0-9A-Fa-f]{8}"/) { print "OK\n"; } else { print "NotOK\n"; }'
< /tmp/vodbrowser.php

 
However, bb-hosts line fails on the regex check: 10.100.104.53
seachange-vod   # testip
cont=vod;http://mrteeny/vod/vodbrowser.php;assetID="[0-9A-Fa-f]{8}";

 
It *is* a webpage I'm trying to match... so the page starts with:

<html>
<head>
<title>VOD Interface</title>
</head>
<body bgcolor=white>
<h3 align=center>Vod Interface</h3>
<pre>
assetID="00080002"

 
However, I really only care if the assetID is being displayed.  Any
suggestions?
list Simeon Berkley · Wed, 27 Aug 2008 10:06:52 -0400 ·
quoted from Kimberly McKinnis
Kimberly McKinnis wrote:
Hmm. Hobbit seems to have not liked the digit range.

Using assetID="[0-9abcdefABCDEF]{8}" is working. I’m not clear **why** Hobbit didn’t like my digit range when perl did, and I’m curious to figure it out, but for now I’m happy that my check works.

 
A handy tool for checking Perl-compatible regexes is pcretest, which is a more direct way of checking since it uses libpcre like hobbit does.


-- 
S i m e o n  B e r k l e y

Systems Engineer
Mcclatchy Interactive
list Kimberly McKinnis · Wed, 27 Aug 2008 13:29:28 -0700 ·
Thank you much!
quoted from Simeon Berkley

-----Original Message-----
From: Simeon Berkley [mailto:user-7650b51cc6e3@xymon.invalid] Sent: Wednesday, August 27, 2008 7:07 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] cont check regex problems

Kimberly McKinnis wrote:
Hmm. Hobbit seems to have not liked the digit range.

Using assetID="[0-9abcdefABCDEF]{8}" is working. I'm not clear **why**
Hobbit didn't like my digit range when perl did, and I'm curious to figure it out, but for now I'm happy that my check works.

 
A handy tool for checking Perl-compatible regexes is pcretest, which is
a more direct way of checking since it uses libpcre like hobbit does.


-- 
S i m e o n  B e r k l e y

Systems Engineer
Mcclatchy Interactive