Xymon Mailing List Archive search

Valid alerts decleration?

list Henrik Størner
Thu, 27 Jan 2005 22:33:39 +0000 (UTC)
Message-Id: <ctbq83$fb$user-e356fad9864f@xymon.invalid>

In <user-cbc4a6f02bf7@xymon.invalid> "Bruce Lysik" <user-4e63a10f8934@xymon.invalid> writes:
$HG-TEST=host01|host02
HOST=$HG-TEST
       SCRIPT /opt/bb/server/ext/email bruce_mail
       MAIL user-4e63a10f8934@xymon.invalid
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 user-4e63a10f8934@xymon.invalid 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