You are here

function ultimate_cron_nagios_settings in Ultimate Cron 8

Same name and namespace in other branches
  1. 8.2 ultimate_cron.nagios.inc \ultimate_cron_nagios_settings()
  2. 6 ultimate_cron.nagios.inc \ultimate_cron_nagios_settings()
  3. 7 ultimate_cron.nagios.inc \ultimate_cron_nagios_settings()

Implementation of hook_nagios_settings().

File

./ultimate_cron.nagios.inc, line 31

Code

function ultimate_cron_nagios_settings() {
  $form = array();
  foreach (ultimate_cron_nagios_functions() as $function => $description) {
    $var = 'ultimate_cron_nagios_func_' . $function;
    $form[$var] = array(
      '#type' => 'checkbox',
      '#title' => $function,
      '#default_value' => variable_get($var, TRUE),
      '#description' => $description,
    );
  }
  $group = 'thresholds';
  $form[$group] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#title' => t('Thresholds'),
    '#description' => t('Thresholds for reporting critical alerts to Nagios.'),
  );
  $form[$group]['ultimate_cron_nagios_running_threshold'] = array(
    '#type' => 'textfield',
    '#title' => t('Running jobs count'),
    '#default_value' => variable_get('ultimate_cron_nagios_running_threshold', 50),
    '#description' => t('Issue a critical alert when more than this number of jobs are running. Default is 50.'),
  );
  $form[$group]['ultimate_cron_nagios_failed_threshold'] = array(
    '#type' => 'textfield',
    '#title' => t('Failed jobs count'),
    '#default_value' => variable_get('ultimate_cron_nagios_failed_threshold', 10),
    '#description' => t('Issue a critical alert when more than this number of jobs failed their last run. Default is 10.'),
  );
  $form[$group]['ultimate_cron_nagios_longrunning_threshold'] = array(
    '#type' => 'textfield',
    '#title' => t('Long running jobs'),
    '#default_value' => variable_get('ultimate_cron_nagios_longrunning_threshold', 0),
    '#description' => t('Issue a critical alert when more than this number of jobs are running longer than usual. Default is 0.'),
  );
  return $form;
}