Xymon Mailing List Archive search

XYMON - corrective measures?

list Tom S
Fri, 23 Dec 2011 17:17:35 -0500
Message-Id: <user-97ed94969c7e@xymon.invalid>

Thanks Henrik,

So this should do it?
HOST=www.foo.com <http://www.foo.com>; SERVICE=http
MAIL user-d0a7de99275f@xymon.invalid <mailto:user-d0a7de99275f@xymon.invalid> DURATION>2 COLOR=red
SCRIPT /usr/local/bin/restartapache.sh 123456789 REPEAT 1440

That above will email user-d0a7de99275f@xymon.invalid after 2 minutes of RED
It will also call up /usr/local/bin/restartapache.sh and run it once every
24 hours if it's down that long?

Do I need to put in a DURATION on that one also or does it keep the 2
minutes from the above line or does it run it as soon as it see's it's
red?  Can I put a DURATION on that also? (eg. SCRIPT
/usr/local/bin/restartapache.sh 123456789 REPEAT 1440 DURATION>2 )

thanks!!
On Fri, Dec 23, 2011 at 5:05 PM, Henrik Størner <user-ce4a2c883f75@xymon.invalid> wrote:
On 23-12-2011 22:57, Tom S wrote:
Thanks.

So this will work?: (example in alerts.cfg)
HOST=www.foo.com <http://www.foo.com>; SERVICE=http
MAIL user-d0a7de99275f@xymon.invalid <mailto:user-d0a7de99275f@xymon.invalid> DURATION>2 COLOR=red
SCRIPT /usr/local/bin/restartapache.**sh
Check the alerts.cfg man-page, you need a "recipient" on the SCRIPT
command - if you don't use it, just put dummy text after the command.


 and in restartapache.sh I would have the following:
#/bin/bash
ssh xymon at web1-server 'sudo /etc/init.d/apache2 restart'
exit
(considering xymon is in the sudoers list)

How can I make sure that the 'SCRIPT /usr/local/bin/restartapache.**sh'
is
only run once per alert in case of network issues (connecting to port
80) it doesn't keep trying to ssh and restarting the server every few
minutes?
Use REPEAT to limit it to e.g. once every 24 hours. Note that the
repeat-setting gets reset once the alert clears, so it will work OK even if
the server goes down at 10 AM, comes back up, and then goes down again at 7
PM; in both cases the script will be called.


Regards,
Henrik

______________________________**
Xymon at xymon.com<