[hobbit] Valid alerts decleration?

Henrik Storner henrik at hswn.dk
Mon Jan 31 22:00:38 CET 2005


In <41FE845B.9090700 at nandomedia.com> Tom Georgoulias <tgeorgoulias at nandomedia.com> writes:

[snip patch and example]

>Now I want to put that macro I got from the shell script into action. 
>It should look something like this, right?

>$HG1=%(pinky.nandomedia.com|sys(.*)p.nandomedia.com)

>or better

>$HG1=%(pinky|sys(.*)p).nandomedia.com

>But that "(.*)" looks funny to me.  All it should represent in that case 
>is a number like 507, 405, etc., or something that perl could handle 
>with a /\d{3}/.  The end result needs to be a hostname like 
>"sys452p.nandomedia.com".  What would be the correct syntax, or is that 
>indeed the correct syntax?


Feel free to educate me on the finer details of Perl and the way it
does regular expressions - I'm not in any way an expert on that
subject. (I never could get my head twisted enough to figure out what
all the different parenthesis and special chars do in Perl - so
there's another reason why I've tried to make LARRD obsolete).

Yes, I think you can do without those parentheses. I actually have a
small test tool to try and match names against expressions, and if I 
try your expression it works whether I have "(.*)" or just ".*". So

  $HG1=%(pinky|sys.*p).nandomedia.com

should be fine.


Henrik



More information about the Xymon mailing list