Server Monitoring with the Cron Monitor

Description

With this monitor you monitor the correct execution of cron jobs. Just trigger an HTTP Request (e.g. via CURL) at the end of the cron job execution. Optionally you can transfer a result or performance metrics.

If there is no message from the cron job after the due date or the result contains an error message, an alarm is triggered.

Parameter

Cron Expression
Cron Definition from the crontab (Standardwert: * * * * *)

Time zone
Timezone of the server time

Timeout
[Minutes]
Time that may elapse after execution before an alarm is triggered

Search term OK
Text that must be found in the submitted result text and indicates the cron execution was OK.
Note that the search string must match exactly, especially when it comes to upper and lower case.

Search term Warning
Text that must be found in the submitted result text and indicates the cron execution was in WARNING state.
Note that the search string must match exactly, especially when it comes to upper and lower case.

Search term Critical
Text that must be found in the submitted result text and indicates the cron execution was in CRITICAL state
Note that the search string must match exactly, especially when it comes to upper and lower case.

Has Performance Data
Activate this option if the check return performance data.
These data will be shown in the performance chart. Just add &performance=VALUE to the HTTP request.
(eg. &=performance=1.23)

Performance Title
Name of the performance values
(eg. Load or Free RAM)

Performance Unit
Unit of the performance values
(eg. Sec or GByte)

Performance Digits
Number of decimal places of the performance values
The measured and calculated avarage values will be rounded with the given number of decimal places.

Availability Report

OK
Cron was executed and an optional search term OK was found

Warning
Cron was executed and an optionally specified search term WARNING was found

Critical
Cron was not executed or an optional search term CRITICAL was found

Unknown
The keep alive call was not received within the last 24 hours

Monitor Integration

Crontab
# m h dom mon dow command
8 6 * * * /var/commands/backup.sh && curl -fsS -m 10 --retry 5 -o /dev/null <CHECK URL>

Bash
# using curl (10 second timeout, retry up to 5 times):
curl -m 10 --retry 5 <CHECK URL>
# using wget (10 second timeout, retry up to 5 times):
wget <CHECK URL> -T 10 -t 5 -O /dev/null

PHP
file_get_contents('<CHECK URL>');

Making the check false alert safe
A cron could run successfully but the server has connection problems and the cron message cannot be submitted. As an result an alert would be sent out. To avoid this kind of false alerts you can optionally call https://psvX.serverguard24.de/alive (replace X by the number of the provided address) every minute.
* * * * * curl -sS -m 10 --retry 5 -o /dev/null https://psvX.serverguard24.de/alive
An alert will be sent out if we received the alive call within the last minute and the cron didn't send any messsage.