Xymon Mailing List Archive search

Question on controlling alerts.

2 messages in this thread

list Jacob P Jordan · Tue, 30 Jun 2020 17:08:34 -0500 ·
If I have multiple files being checked or multiple services being checked how do I control alerts for a specific item.? Such as two processes:? Process1 and Process2.? One of them goes red.? How do I send an alert based on the correct item.? Is it indexed or something.? I have looked in forums and email history for last several years but have not found how to do this?

Thanks Paul Jordan
list Ralph Mitchell · Wed, 1 Jul 2020 01:00:19 -0400 ·
This may not be the best way, but what I do for filesystems and processes
is to use SCRIPT as the alert method.  The script is handed the entire
content of the message that triggered the alert in the BBALPHAMSG
environment variable.  If you take a look at the
xymon/server/etc/alerts.cfg file you'll see a list of all the other
environment variables that get passed.

I currently have the following filesystems alerting for a server:

&yellow? /archive (94% used) has reached the WARNING level (90%)
?&yellow /stuff (90% used) has reached the WARNING level (90%)

In the web page display, the &yellow is replaced by the yellow dot image,
but in BBALPHAMSG it's as above.  So, in bash:

     YELLOW=`echo "$BBALPHAMSG" | grep &yellow | sed -e 's/&yellow //'`
     RED=`echo "$BBALPHAMSG" | grep &red | sed -e 's/&red //'`

separates out the red and yellow tagged filesystems and removes the color.
I can then iterate through each list looking at the first word on each line
to see which filesystem has a problem and then spit out an appropriate
message to whomever needs to be informed.  You can use whatever programming
language you're comfortable with, as long as you can access BBALPHAMSG in
the environment.

Ralph Mitchell
quoted from Jacob P Jordan


On Wed, Jul 1, 2020 at 12:27 AM Jacob P Jordan <user-824ef39189a5@xymon.invalid> wrote:
If I have multiple files being checked or multiple services being
checked how do I control alerts for a specific item.  Such as two
processes:  Process1 and Process2.  One of them goes red.  How do I send
an alert based on the correct item.  Is it indexed or something.  I have
looked in forums and email history for last several years but have not
found how to do this?

Thanks Paul Jordan