Xymon Mailing List Archive search

Combining Macros in alerts.cfg EXHOST?

list Jeremy Laidman
Wed, 28 Nov 2012 10:55:33 +1100
Message-Id: <CAAnki7CNrqCwuGVxvpFr-C8AkwYqa6LWt5Qtkika=user-49a4e1c06cba@xymon.invalid>

On 28 November 2012 07:32, Betsy Schwartz <user-c61747246f66@xymon.invalid> wrote:
I'm not getting this to work , with various combinations :
    %($NOPAGE,$VIP)
Can you use a comma in this context?  If so, this is news to me, and I
don't think it's reflected in the doco.  If not, it could explain why your
$VIP is not matching, although I don't know

    %($NOPAGE|$VIP)
I think this should work, as long as you remove the percent (%) from the
macros, and as long as the commas in $VIP are addressed (assuming commas
are invalid).  So:

   $NOPAGE=(^.*eng|^netmon2).example.com
   $VIP=(^web|^ftp|^mail-relay).example.com|web-vip|mail-vip
   HOST=* EXHOST=%($NOPAGE|$VIP) ...

[I'm assuming you had a typo in your NOPAGE definition: "^*.eng" should be
"^.*eng"]

You can simplify these regexps by putting the caret only once at the start:

   $NOPAGE=^(.*eng|netmon2).example.com
   $VIP=^(web|ftp|mail-relay).example.com|web-vip|mail-vip

Or even moving the carets to the EXHOST definition:

   $NOPAGE=(*.eng|netmon2).example.com
   $VIP=(web|ftp|mail-relay).example.com|web-vip|mail-vip
   HOST=* EXHOST=%^($NOPAGE|$VIP) ...

Cheers
Jeremy