Xymon Mailing List Archive search

hobbitd_alert --test color matching

list Dominique Frise
Fri, 07 Jul 2006 08:25:30 +0200
Message-Id: <user-64a852d84c12@xymon.invalid>

Dominique Frise wrote:
Hi,

We cannot test our rules with other color than red: the matching messages always show same results for the "red" color:

[bb at iris bin]$ ./hobbitd_alert --test bilbo msgs red | egrep "Match with|Mail alert|Script alert"
00017141 2006-07-06 11:05:04 *** Match with 'PAGE=%^$ ***
00017141 2006-07-06 11:05:04 *** Match with '$MAIL_DH' ***
00017141 2006-07-06 11:05:04 Mail alert with command 'mail -s "Hobbit [12345] bilbo:msgs CRITICAL (RED)" user-e8184fe87a2e@xymon.invalid'
00017141 2006-07-06 11:05:04 *** Match with 'HOST=$ADMIN_HOSTS' ***
00017141 2006-07-06 11:05:04 *** Match with '$SMS_DH' ***
00017141 2006-07-06 11:05:04 Script alert with command '/soft/pub/BB/hobbit/server/bin/sendsms' and recipient 0123456789
00017141 2006-07-06 11:05:04 *** Match with 'HOST=*' ***
00017141 2006-07-06 11:05:04 *** Match with '$MAIL_ROOT UNMATCHED' ***

[bb at iris bin]$ ./hobbitd_alert --test bilbo msgs yellow | egrep "Match with|Mail alert|Script alert"
00017239 2006-07-06 11:05:56 *** Match with 'PAGE=%^$ ***
00017239 2006-07-06 11:05:56 *** Match with '$MAIL_DH' ***
00017239 2006-07-06 11:05:56 Mail alert with command 'mail -s "Hobbit [12345] bilbo:msgs CRITICAL (RED)" user-e8184fe87a2e@xymon.invalid'
00017239 2006-07-06 11:05:56 *** Match with 'HOST=$ADMIN_HOSTS' ***
00017239 2006-07-06 11:05:56 *** Match with '$SMS_DH' ***
00017239 2006-07-06 11:05:56 Script alert with command '/soft/pub/BB/hobbit/server/bin/sendsms' and recipient 0123456789
00017239 2006-07-06 11:05:56 *** Match with 'HOST=*' ***
00017239 2006-07-06 11:05:56 *** Match with '$MAIL_ROOT UNMATCHED' ***


Same results with "purple" color.

PS: this is 4.2-beta-10060601

Any ideas?

Dominique
UNIL - University of Lausanne

OK, After looking in hobbtid_alert.c, it is now obvious that for testing colors other than red, the "duration" parameter must also be given:


[bb at iris bin]$ ./hobbitd_alert --test bilbo msgs 0 yellow | egrep "Match with|Mail alert|Script alert"
00008430 2006-07-07 08:20:30 *** Match with 'PAGE=%^$' ***
00008430 2006-07-07 08:20:30 *** Match with '$MAIL_DH' ***
00008430 2006-07-07 08:20:30 Mail alert with command 'mail -s "Hobbit [12345] bilbo:msgs warning (YELLOW)" user-e8184fe87a2e@xymon.invalid'
00008430 2006-07-07 08:20:30 *** Match with 'HOST=$ADMIN_HOSTS' ***
00008430 2006-07-07 08:20:30 *** Match with 'HOST=*' ***
00008430 2006-07-07 08:20:30 *** Match with '$MAIL_ROOT UNMATCHED' ***

Same issue using today's snapshot (4.2-beta-20060605.3)


Sorry for not understanding this from the man page ;-)

  --test HOST SERVICE [duration [color [time]]]

Dominique
UNIL - University of Lausanne