Xymon Mailing List Archive search

Nesting rules in hobbit-alerts.cfg

5 messages in this thread

list Gary Baluha · Mon, 17 Mar 2008 13:26:29 -0400 ·
Is it possible to nest rules in hobbit-alerts.cfg?  For example, can I do
something like this (indenting provided for readability):

PAGE=hostPageA NOTICE RECOVERED
     HOST=hostA,hostB,hostC
          MAIL user-662c32254ab8@xymon.invalid
     HOST=%(hostD[0-9])
          MAIL user-2a94730ebdd3@xymon.invalid

Our alerting rules are starting to get kind of complex, and nesting alert
rules as above would make things easier.  I know I could do something like:

PAGE=hostPageA NOTICE RECOVERED
     MAIL user-662c32254ab8@xymon.invalid HOST=hostA,hostB,hostC
     MAIL user-2a94730ebdd3@xymon.invalid HOST=%(hostD[0-9])

But some of the HOST= lists are very long (i.e. wrap across multiple lines),
so the above 2nd example would look a lot uglier than it does in this post
(which was simplified for readability).  If nesting rules won't work, I
wonder how much effort would be involved in adding this feature.
list Patrick Nixon · Mon, 17 Mar 2008 13:41:23 -0400 ·
Did you look into maybe making a host group out of them?

I forget the hobbit term for them of course, but I know you can do
groups, which is a regex or simple declaration.
quoted from Gary Baluha

On Mon, Mar 17, 2008 at 1:26 PM, Gary Baluha <user-ae3e15c22de1@xymon.invalid> wrote:
Is it possible to nest rules in hobbit-alerts.cfg?  For example, can I do
something like this (indenting provided for readability):

PAGE=hostPageA NOTICE RECOVERED
     HOST=hostA,hostB,hostC
          MAIL user-662c32254ab8@xymon.invalid
      HOST=%(hostD[0-9])
          MAIL user-2a94730ebdd3@xymon.invalid

Our alerting rules are starting to get kind of complex, and nesting alert
rules as above would make things easier.  I know I could do something like:

PAGE=hostPageA NOTICE RECOVERED
     MAIL user-662c32254ab8@xymon.invalid HOST=hostA,hostB,hostC
     MAIL user-2a94730ebdd3@xymon.invalid HOST=%(hostD[0-9])

But some of the HOST= lists are very long (i.e. wrap across multiple lines),
so the above 2nd example would look a lot uglier than it does in this post
(which was simplified for readability).  If nesting rules won't work, I
wonder how much effort would be involved in adding this feature.
list Gary Baluha · Mon, 17 Mar 2008 13:47:02 -0400 ·
That was one thought I had, but the current version of Hobbit doesn't
display the group alerting under the "info" column.  But I do currently have
some group alerts set up.  I'm just looking at ways to clean up and simplify
the alert rules.
quoted from Patrick Nixon

On Mon, Mar 17, 2008 at 1:41 PM, Patrick Nixon <user-1f2406f832af@xymon.invalid> wrote:
Did you look into maybe making a host group out of them?

I forget the hobbit term for them of course, but I know you can do
groups, which is a regex or simple declaration.

On Mon, Mar 17, 2008 at 1:26 PM, Gary Baluha <user-ae3e15c22de1@xymon.invalid> wrote:
Is it possible to nest rules in hobbit-alerts.cfg?  For example, can I
do
something like this (indenting provided for readability):

PAGE=hostPageA NOTICE RECOVERED
     HOST=hostA,hostB,hostC
          MAIL user-662c32254ab8@xymon.invalid
      HOST=%(hostD[0-9])
          MAIL user-2a94730ebdd3@xymon.invalid

Our alerting rules are starting to get kind of complex, and nesting
alert
rules as above would make things easier.  I know I could do something
like:

PAGE=hostPageA NOTICE RECOVERED
     MAIL user-662c32254ab8@xymon.invalid HOST=hostA,hostB,hostC
     MAIL user-2a94730ebdd3@xymon.invalid HOST=%(hostD[0-9])

But some of the HOST= lists are very long (i.e. wrap across multiple
lines),
so the above 2nd example would look a lot uglier than it does in this
post
(which was simplified for readability).  If nesting rules won't work, I
wonder how much effort would be involved in adding this feature.
list Stewart L · Mon, 17 Mar 2008 13:48:55 -0400 ·
You could use macros...

$hg-pager=%(^hostA|$hostB|^hostC)
$hg-email=%%(hostD[0-9])

PAGE=hostPageA NOTICE RECOVERED
     HOST=$hg-pager
          MAIL user-662c32254ab8@xymon.invalid
     HOST=$hg-email
          MAIL user-2a94730ebdd3@xymon.invalid

This keeps all the clutter out of the rule sets.

Stewart
quoted from Gary Baluha


On Mon, Mar 17, 2008 at 1:26 PM, Gary Baluha <user-ae3e15c22de1@xymon.invalid> wrote:
Is it possible to nest rules in hobbit-alerts.cfg?  For example, can I do
something like this (indenting provided for readability):

PAGE=hostPageA NOTICE RECOVERED
     HOST=hostA,hostB,hostC
          MAIL user-662c32254ab8@xymon.invalid
     HOST=%(hostD[0-9])
          MAIL user-2a94730ebdd3@xymon.invalid

Our alerting rules are starting to get kind of complex, and nesting alert
rules as above would make things easier.  I know I could do something like:

PAGE=hostPageA NOTICE RECOVERED
     MAIL user-662c32254ab8@xymon.invalid HOST=hostA,hostB,hostC
     MAIL user-2a94730ebdd3@xymon.invalid HOST=%(hostD[0-9])

But some of the HOST= lists are very long (i.e. wrap across multiple
lines), so the above 2nd example would look a lot uglier than it does in
this post (which was simplified for readability).  If nesting rules won't
work, I wonder how much effort would be involved in adding this feature.
-- 

Stewart

The revolution will not be televised.
The revolution will be no re-run brothers;
The revolution will be live.
list Sebastian Auriol · Tue, 18 Mar 2008 19:26:39 -0000 ·
Gary,
 
One way to clean up and simplify your alert rules is to use a (host group)
macro, as in http://www.hswn.dk/hobbiton/2005/01/msg00287.html (but see also
http://www.hswn.dk/hobbiton/2005/01/msg00123.html for a tighter syntax) so
long as these macros can run across lines...
 
Sebastian
quoted from Gary Baluha


From: Gary Baluha [mailto:user-ae3e15c22de1@xymon.invalid] 
Sent: 17 March 2008 17:47
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Nesting rules in hobbit-alerts.cfg


That was one thought I had, but the current version of Hobbit doesn't
display the group alerting under the "info" column.  But I do currently have
some group alerts set up.  I'm just looking at ways to clean up and simplify
the alert rules.


On Mon, Mar 17, 2008 at 1:41 PM, Patrick Nixon <user-1f2406f832af@xymon.invalid> wrote:


Did you look into maybe making a host group out of them?

I forget the hobbit term for them of course, but I know you can do
groups, which is a regex or simple declaration.


On Mon, Mar 17, 2008 at 1:26 PM, Gary Baluha <user-ae3e15c22de1@xymon.invalid> wrote:
Is it possible to nest rules in hobbit-alerts.cfg?  For example, can I do
something like this (indenting provided for readability):

PAGE=hostPageA NOTICE RECOVERED
     HOST=hostA,hostB,hostC
          MAIL user-662c32254ab8@xymon.invalid
      HOST=%(hostD[0-9])
          MAIL user-2a94730ebdd3@xymon.invalid

Our alerting rules are starting to get kind of complex, and nesting alert
rules as above would make things easier.  I know I could do something
like:

PAGE=hostPageA NOTICE RECOVERED
     MAIL user-662c32254ab8@xymon.invalid HOST=hostA,hostB,hostC
     MAIL user-2a94730ebdd3@xymon.invalid HOST=%(hostD[0-9])

But some of the HOST= lists are very long (i.e. wrap across multiple
lines),
so the above 2nd example would look a lot uglier than it does in this post
(which was simplified for readability).  If nesting rules won't work, I
wonder how much effort would be involved in adding this feature.