Monitoring Cron jobs

Andreas Ericsson ae at op5.se
Thu Jul 1 12:38:41 CEST 2004


Enrique.Melero at reuters.com wrote:
> Anyone has a good way to monitor correct running of cron jobs using nagios ?
> 
> We currently rely on mail to send stderr of the jobs. It would be a good idea
> to attach a service to each of the cron jobs .
> 
> This could be done by defining a special shell that runs the jobs and will send
> the correct status to a defined service.
> 
> My Cron would look like this:
> 
> MYSHELL=/usr/local/bin/nagiosawaresh
> 00 * * * *  check_Client_db_consistency   %DB Consistency Checking%
> 01* * * *  check_Products_db_consistency   %DB Consistency Checking%
> 02 * * * * *   my job 1 %Service 1 for which job 1 is important%
> * 10 * * * *   my job 2 %Service 1 for which job 2 is important%
> 
> The contents inside the percentage marks are passed through stdin to the shell , as per
> standard Visie Cron behaviour .
> 
> The nagiosawareshell would capture STDERR and return status of the job and
> send the correct info the the nagios.cmd pipe .
> 
> Is this making sense ? or is there another better way ?
> 

Seems like an awful lot of work to me. Why don't you just let the 
cron-jobs themselves send a passive service check result to the nagios 
pipe, and set the check_freshness options to something appropriate?
That way the jobs themselves have to define whether or not they 
succeeded, which seems like the right way to go. If the job doesn't run 
at all, nagios sends alerts since the service-check goes stale 
(providing nice monitoring of the cron daemon as well).

-- 
Sourcerer / Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
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