Xymon Mailing List Archive search

Nesting rules in hobbit-alerts.cfg

list Stewart L
Mon, 17 Mar 2008 13:48:55 -0400
Message-Id: <user-de5cb012f66b@xymon.invalid>

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


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.