[hobbit] Valid alerts decleration?

Henrik Storner henrik at hswn.dk
Thu Jan 27 23:33:39 CET 2005


In <12C0877BF55C7748BDDB82BDBD3E66F1378A73 at franklin.corp.shutterfly.com> "Bruce Lysik" <blysik at shutterfly.com> writes:

>$HG-TEST=host01|host02

>HOST=$HG-TEST
>        SCRIPT /opt/bb/server/ext/email bruce_mail
>        MAIL blysik at shutterfly.com

>And then I run the dump config:

>-bash-2.05b$ ./bin/bbcmd --env=etc/hobbitserver.cfg hobbitd_alert --dump-config
>HOST= 
>        SCRIPT /opt/bb/server/ext/email bruce_mail FORMAT=SCRIPT REPEAT=30 
>        MAIL blysik at shutterfly.com REPEAT=30 

>Shouldn't there be some hosts showing up after HOST= ?

Hmm - yes, there should. This should fix it:

diff -u -r1.28 hobbitd/do_alert.c
--- hobbitd/do_alert.c  2005/01/20 10:45:44     1.28
+++ hobbitd/do_alert.c  2005/01/27 22:20:46
@@ -355,7 +355,7 @@

                        delim = strchr(l, '=');
                        *delim = '\0';
-                       newtok->name = strdup(l);
+                       newtok->name = strdup(l+1);     /* Skip the '$' */
                        newtok->value = strdup(delim+1);
                        newtok->next = tokhead;
                        tokhead = newtok;


But your $HG-TEST definition is also wrong. If it's a regular
expression, it should be "$HG-TEST=(host01|host02)" - if it's just a
simple list, it should be "$HG-TEST=host01,host02


Henrik



More information about the Xymon mailing list