[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hearbeat
From: |
SorinS |
Subject: |
Re: hearbeat |
Date: |
Mon, 07 Nov 2005 22:57:44 +0000 |
Hi Daniel,
Of course I can do it with a script, and your script is very nicely
written.
I can do _whatever_ monit does using scripts and standard unix
utilities. But when you think about lots of machines running Linux,
Solaris, HPUX, etc - these scripts might turn into a nightmare to
maintain, version, upgrade, etc.
That is where monit rocks - you have a single executable plus a config.
There cannot be anything simpler than that. No crons, no scripts with
binary dependencies, a single log file (not multiple log files with
locking, etc), fantastic.
So if it can do heartbeating, it would be even better.
If we can have a more flexible framework for logging (e.g. log4c) and
alerting (mail/write_to_files/snmp/xmpp/etc) so we can integrate it with
other software it would be superb.
Thanks,
Sorin
On Tue, 2005-11-08 at 11:30 +1300, Daniel wrote:
> 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
>
>
>