Xymon Mailing List Archive search

alerts macro feature request

5 messages in this thread

list Bruce Lysik · Mon, 31 Jan 2005 14:57:06 -0800 ·
Hi,

So I was defining an alert, when I tried to do this:

HOST=$GROUP1,$GROUP2 EXHOSTS=$SUBGROUP1,$SUBGROUP2	

I don't know how hard this would be to fit in, but it could be useful.

--
Bruce Z. Lysik  <user-4e63a10f8934@xymon.invalid>
Operations Engineer
list Henrik Størner · Tue, 1 Feb 2005 16:37:29 +0100 ·
quoted from Bruce Lysik
On Mon, Jan 31, 2005 at 02:57:06PM -0800, Bruce Lysik wrote:
Hi,

So I was defining an alert, when I tried to do this:

HOST=$GROUP1,$GROUP2 EXHOSTS=$SUBGROUP1,$SUBGROUP2
If your macros are not regular expressions, then it should just work.

If they are regular expressions, I suppose it would work if you
kept the "%" sign out of the expression, and did this:

HOST=%$GROUP1|$GROUP2 EXHOSTS=$SUBGROUP1|$SUBGROUP2


Henrik
list Bruce Lysik · Tue, 1 Feb 2005 10:09:34 -0800 ·
quoted from Henrik Størner
HOST=$GROUP1,$GROUP2 EXHOSTS=$SUBGROUP1,$SUBGROUP2
If your macros are not regular expressions, then it should just work.
That's what I was hoping, but it doesn't seem to be.  I modified that shell script to create comma seperated lists of hosts.

So I have $GROUP1=host1,host2 and $GROUP2=host3,host4

And when I try to do HOST=$GROUP1,$GROUP2 and run  ../bin/bbcmd --env=hobbitserver.cfg hobbitd_alert --dump-config:

HOST=

Just blank.
quoted from Henrik Størner

--
Bruce Z. Lysik  <user-4e63a10f8934@xymon.invalid>
Operations Engineer

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Tuesday, February 01, 2005 7:37 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] alerts macro feature request


On Mon, Jan 31, 2005 at 02:57:06PM -0800, Bruce Lysik wrote:
Hi,
So I was defining an alert, when I tried to do this:
If they are regular expressions, I suppose it would work if you
kept the "%" sign out of the expression, and did this:
HOST=%$GROUP1|$GROUP2 EXHOSTS=$SUBGROUP1|$SUBGROUP2


Henrik

list Henrik Størner · Tue, 1 Feb 2005 22:09:01 +0100 ·
quoted from Bruce Lysik
On Tue, Feb 01, 2005 at 10:09:34AM -0800, Bruce Lysik wrote:
HOST=$GROUP1,$GROUP2 EXHOSTS=$SUBGROUP1,$SUBGROUP2
If your macros are not regular expressions, then it should just work.
That's what I was hoping, but it doesn't seem to be.
Ah, I think I know what's happening. At line 208 of hobbitd/do_alert.c:
 
               n = strcspn(p, " \t");
Should be
               n = strcspn(p, "\t $.,|%!()[]{}+?/&@:;*");


Henrik
list Bruce Lysik · Tue, 1 Feb 2005 14:23:51 -0800 ·
quoted from Henrik Størner
That's what I was hoping, but it doesn't seem to be.
Ah, I think I know what's happening. At line 208 of hobbitd/do_alert.c:
                n = strcspn(p, " \t");
Should be
               n = strcspn(p, "\t $.,|%!()[]{}+?/&@:;*");
Almost.  Now the --dump-config shows the macro expanded for the first group, but not the second.

For example, HOST=$group1,$group2 shows as HOST=group1member1,group1member2
quoted from Bruce Lysik

--
Bruce Z. Lysik  <user-4e63a10f8934@xymon.invalid>
Operations Engineer

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Tuesday, February 01, 2005 1:09 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] alerts macro feature request


On Tue, Feb 01, 2005 at 10:09:34AM -0800, Bruce Lysik wrote:
HOST=$GROUP1,$GROUP2 EXHOSTS=$SUBGROUP1,$SUBGROUP2
If your macros are not regular expressions, then it should just work.
Henrik