[Nagiosplug-help] how to monitor crond service

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Sep 5 13:27:06 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/09/08 02:52 AM, asam30 at gmail.com wrote:
> Hi,
> 
> I've few of HP UX and Linux boxes that were monitored by Nagios. for the
> past few days, I've observed that cron service on HP UX keeps shutting
> down and I need to manually restart cron service. Is there any way
> through nagios we can monitor cron service on HP UX or Linux boxes so I
> can login before no one compliance and restart the service?

Please do not cross-post to multiple mailing lists.

if you have NSCA running on the Nagios server and send_nsca on the
client (and properly configured), do the following:

1. Create a passive service on Nagios (ex.: "Cron")
2. Set the freshness threshold for that service (ex.: 350 seconds), and
use check_dummy as the active check (returning WARNING or CRITICAL
depending on your preferences)
3. On the server, add a cron entry (according that the threshold in 3 is
adjusted for 5-minute intervals):
> */5 * * * * nagios echo -e "<hostname>\tCron\t0\tOK: Cron is running" | /path/to/send_nsca -H <monitor_host> -c <config_file>
NB.: I don't know about HP-UX but some cron daemons do not support */5
so you have to put "0,5,10,15,20,etc..." instead. If you're editing a
user crontab, remove the "nagios" argument (some cron do not support
system crontabs at all so you must edit a user's crontab)


Although if you're running important scripts/programs from crond, you
could simply monitor the scripts/rograms either by modifying them where
possible, or using a wrapper script to report status to send_nsca. This
way you won't have to monitor the daemon itself.


Oh, another way is to use check_procs, looking fro "crond", but if your
daemon just locks the check won't fail.

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIwReK6dZ+Kt5BchYRAg9JAJ47IpfGEOyRkc54mXKeVpNGwvxQGgCfX/Du
1I4wPR5lQEi9NKNa5DZTk8w=
=JAcQ
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list