You are here

function nagios_check_cron in Nagios Monitoring 6

Same name and namespace in other branches
  1. 8 nagios.module \nagios_check_cron()
  2. 5 nagios.module \nagios_check_cron()
  3. 7 nagios.module \nagios_check_cron()

Check when the Drupal cron system was last invoked.

Return value

Array

File

./nagios.module, line 671

Code

function nagios_check_cron() {
  $cron_last = variable_get('cron_last', 0);
  $mins = variable_get('nagios_cron_duration', 60);
  if (time() > $cron_last + $mins * 60) {
    $data = array(
      'status' => NAGIOS_STATUS_CRITICAL,
      'type' => 'state',
      'text' => t('cron not running @mins mins', array(
        '@mins' => $mins,
      )),
    );
  }
  else {
    $data = array(
      'status' => NAGIOS_STATUS_OK,
      'type' => 'state',
      'text' => '',
    );
  }
  return array(
    'key' => 'CRON',
    'data' => $data,
  );
}