monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hearbeat


From: Daniel
Subject: Re: hearbeat
Date: Tue, 08 Nov 2005 11:30:41 +1300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050601

Sorin S. wrote:
Hi Martin, I wanted a heartbeat message to be sure the monit is
up and running as I can't open the firewalls to access
the monit console. The clients are particularly uneasy
to open firewalls externally for monitoring purposes.
But email is security friendly enough and can be
routed with ease.

The message can contain any text with some useful info
(for example: <server_name>,`date`,`uptime`, etc and the subject can be the actual FQDN of the box.
I can then parse the mbox for the heartbeat messages
and alert if I haven't got one from monit in a certain
time. This is particularly usefull is one has hundreds of
machines to look after.
It might be strange, but in my experiece it is
usefull.
Let me know what you think about it...

You could just get them to set up a cron job which did something like a monit summary, which you could then parse.

Perhaps wrap it into a shell script and get it call it in cron.d or someone's crontab as often as you would like.

This gives the FQDN hostname, date, and monit summary output in an e-mail.

You probably would want to use mail instead of nail unless you have it installed. You wouldn't even need it pipe it into anything if you get the mail from cron, but it is nice to get a separate report.

BIG NOTE: You will have to parse it well as the ***FAILING*** message won't work until monit returns failure codes for monit summary/monit status not working.

Regards

Daniel

address@hidden cron.daily]# cat ./monitalive.sh
#!/bin/bash
MONIT=""
monit summary >&/dev/null || MONIT="***FAILING*** "
(
hostname -f;
date;
monit summary 2>&1;
) | nail -r address@hidden -s "$(hostname -f) ${MONIT}monit report" address@hidden



--
Daniel Grant
The Total Team
http://www.totalteam.co.nz/
Ph   0800-888-326, +64-3-348-1667
Cell +64-27-407-2438
Fax  +64- 3-354-1252




reply via email to

[Prev in Thread] Current Thread [Next in Thread]