Python script to check last exec time and exit code of script

I needed a script that checks:

  • whether a cronjob ran at its determined date (that means it runs regulary)
  • if the cronjob ran successfully

It should also be monitor-able via Nagios. That means, it should provide a meaningful output for when something went wrong with the cronjob, e.g. “CRITICAL: cronjob did not run!”

Of course, someone already had the same requirements and built a Perl-script for it, which in turn can be used as a NRPE-plugin.

more ...