[Xymon] Combining Macros in alerts.cfg EXHOST?
Betsy Schwartz
betsy.schwartz at gmail.com
Wed Nov 28 00:10:00 CET 2012
Hm, thanks. I had %( in the rules because I defined the macro without
the %, thinking that might help use | to glue two together. I
initially tried it with two separate macros defined with %( but I
still get a match when I think I should not.
$NOPAGE=%(^xymon.eng.*|^sm05.*|.*ad.example.com)
$VIP=%(^ftp|^images|^mail-relay|^mail-router|^wiki).example.com
[xymon at xymon-dev1 ~]$ /usr/local/xymon/server/bin/xymond_alert --test
wiki.example.com http -color=red | grep -B5 Mail
00031698 2012-11-27 17:58:15 *** Match with 'HOST=*
EXHOST=$NOPAGE,$VIP SERVICE=$TECHOPS_TESTS' ***
00031698 2012-11-27 17:58:15 Matching host:service:dgroup:page
'wiki.example.com:http:NONE:business' against rule line 222
00031698 2012-11-27 17:58:15 Failed 'MAIL xymail repeat=8h
COLOR=yellow FORMAT=TEXT' (color)
00031698 2012-11-27 17:58:15 Matching host:service:dgroup:page
'wiki.example.com:http:NONE:business' against rule line 223
00031698 2012-11-27 17:58:15 *** Match with 'MAIL xymail repeat=5m
COLOR=red FORMAT=TEXT' ***
00031698 2012-11-27 17:58:15 Mail alert with command
'/var/spool/mail/xymon "Xymon [12345] wiki.example.com:http CRITICAL
(RED)" xymail'
00031698 2012-11-27 17:58:15 Matching host:service:dgroup:page
'wiki.example.com:http:NONE:business' against rule line 224
00031698 2012-11-27 17:58:15 *** Match with 'MAIL alert1 REPEAT=10
COLOR=red FORMAT=SMS' ***
00031698 2012-11-27 17:58:15 Mail alert with command 'mail alert1'
--
00031698 2012-11-27 17:58:15 *** Match with 'HOST=wiki.example.com
SERVICE=conn,http' ***
00031698 2012-11-27 17:58:15 Matching host:service:dgroup:page
'wiki.example.com:http:NONE:business' against rule line 335
00031698 2012-11-27 17:58:15 Failed 'MAIL xymail REPEAT=1d
COLOR=yellow FORMAT=TEXT' (color)
00031698 2012-11-27 17:58:15 Matching host:service:dgroup:page
'wiki.example.com:http:NONE:business' against rule line 336
00031698 2012-11-27 17:58:15 *** Match with 'MAIL sysengoncall
REPEAT=10 COLOR=red,purple FORMAT=SMS' ***
00031698 2012-11-27 17:58:15 Mail alert with command 'mail sysengoncall'
When I create the rather horrible:
$NOPAGEANDVIP=%(^xymon.eng.*|^sm05.*|.*ad.example.com)|(^ftp|^images|^mail-relay|^mail-router|^wiki).example.com
the test does work as expected
00000469 2012-11-27 18:05:35 Failed 'HOST=* EXHOST=$NOPAGEANDVIP
SERVICE=$TECHOPS_TESTS' (hostname excluded)
(I know I can simplify that last regexp, just put it in for proof-of-concept)
Going to go redefine my host lists now but it would be nice to get this to work
More information about the Xymon
mailing list