Xymon Mailing List Archive search

Valid alerts decleration?

list Tom Georgoulias
Mon, 31 Jan 2005 14:17:47 -0500
Message-Id: <user-2ff352ecd79c@xymon.invalid>

Henrik Storner wrote:

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;
I'm tired ... "$HG-TEST=%(host01|host02)" since a "%" is needed to
flag it as a pc-regex.
OK, I'm trying to get my alerts file setup using the macros and I'd like to try and summarize all the findings from list postings into a single procedure.  Let me know if this is correct, or at least help steer me in the right direction.  So far:

1. I've used the non-tested, experimental shell script to convert my bbwarnsetup.cfg host groups into hobbit macros.  An example of one host group converted is as follows:

$HG1=pinky.nandomedia.com|sys(.*)p.nandomedia.com

2. I applied the patch above to do_alert.c

Now I want to put that macro I got from the shell script into action. It should look something like this, right?

$HG1=%(pinky.nandomedia.com|sys(.*)p.nandomedia.com)

or better

$HG1=%(pinky|sys(.*)p).nandomedia.com

But that "(.*)" looks funny to me.  All it should represent in that case is a number like 507, 405, etc., or something that perl could handle with a /\d{3}/.  The end result needs to be a hostname like "sys452p.nandomedia.com".  What would be the correct syntax, or is that indeed the correct syntax?

Tom