You are here

function monitoring_icinga_config_passive_page in Monitoring 7

Icinga config passive page callback.

1 string reference to 'monitoring_icinga_config_passive_page'
monitoring_icinga_menu in modules/monitoring_icinga/monitoring_icinga.module
Implements hook_menu().

File

modules/monitoring_icinga/monitoring_icinga.admin.inc, line 11
Monitoring Icinga admin pages.

Code

function monitoring_icinga_config_passive_page() {
  $output[] = array(
    '#type' => 'markup',
    '#markup' => '<div class="messages warning">' . t('Passive result checing is not recommended as in case of the monitored system failure the Icinga server will not get notified of this fact. Due to this the <a href="@url">passive checks with freshness checking</a> is recommended.', array(
      '@url' => url('admin/config/system/monitoring/icinga/passive-with-freshness'),
    )) . '</div>',
  );
  $output[] = array(
    '#theme' => 'monitoring_config_box',
    '#description' => t('Passive services check means the host is responsible for contacting submitting the status data. Info on this page will help you to configure this setup.'),
  );
  $output[] = array(
    '#theme' => 'monitoring_config_box',
    '#title' => t('Prerequisites'),
    '#description' => t('Before continuing with following setup you need to have Icinga server up and running with "nsca" daemon and the "send_nsca" command at the monitored system. Refer to the README.txt for a brief setup procedure.'),
  );
  $output[] = monitoring_icinga_objects_definitions_output(FALSE);
  $conf_path = explode('/', conf_path());
  $output[] = array(
    '#theme' => 'monitoring_config_box',
    '#title' => t('Setting up send_nsca command'),
    '#description' => t('Following script is a working example of retrieving the check results and submitting them to the Icinga server. Create such script at your monitored system and hook it into cron tab to run every five minutes. Make sure all paths are correct.', array(
      '@name' => str_replace('.', '_', monitoring_host()),
    )),
    '#code' => monitoring_config_code('monitoring_icinga', 'submit_check_result', array(
      '@central_server' => 'REPLACE WITH YOUR ICINGA SERVER ADDRESS',
      '@host_name' => monitoring_host(),
      '@root' => DRUPAL_ROOT,
      '@uri' => array_pop($conf_path),
    )),
    '#code_height' => '300',
  );
  return $output;
}