function nagios_check_cron in Nagios Monitoring 7
Same name and namespace in other branches
- 8 nagios.module \nagios_check_cron()
- 5 nagios.module \nagios_check_cron()
- 6 nagios.module \nagios_check_cron()
Check when the Drupal cron system was last invoked.
Return value
array
File
- ./
nagios.module, line 978
Code
function nagios_check_cron() {
$cron_last = variable_get('cron_last', 0);
$minutes = variable_get('nagios_cron_duration', 60);
if (REQUEST_TIME > $cron_last + $minutes * 60) {
$data = [
'status' => NAGIOS_STATUS_CRITICAL,
'type' => 'state',
'text' => t('cron did not run within last @minutes minutes', [
'@minutes' => $minutes,
]),
];
}
else {
$data = [
'status' => NAGIOS_STATUS_OK,
'type' => 'state',
'text' => '',
];
}
return [
'key' => 'CRON',
'data' => $data,
];
}