You are here

function monitoring_icinga_config_passive_with_freshness_page in Monitoring 7

Icinga config active page callback.

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

File

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

Code

function monitoring_icinga_config_passive_with_freshness_page() {
  $output = array();
  $output[] = array(
    '#theme' => 'monitoring_config_box',
    '#description' => t('This approach combines passive and active result checks. In case Icinga freshness check of a sensor will not pass it will conduct a separate active check of the sensor.'),
  );
  $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 and the NRPE connector at the monitored system. Refer to the README.txt for a brief setup procedure.'),
  );
  $output[] = array(
    '#theme' => 'monitoring_config_box',
    '#title' => t('Command definition to issue the remote NRPE call'),
    '#description' => t('In the /etc/icinga/commands.cfg file add following command definition.'),
    '#code' => monitoring_config_code('monitoring_icinga', 'command'),
    '#code_height' => '70',
  );
  $output[] = monitoring_icinga_objects_definitions_output(FALSE, TRUE);
  $conf_path = explode('/', conf_path());
  $output[] = array(
    '#theme' => 'monitoring_config_box',
    '#title' => t('NRPE configuration'),
    '#description' => t('After installing NRPE on the monitored machine in the /etc/nagios/nrpe_local.cfg add following code.'),
    '#code' => monitoring_config_code('monitoring_icinga', 'nrpe_local', array(
      '@root' => DRUPAL_ROOT,
      '@uri' => array_pop($conf_path),
      '@site_key' => monitoring_host_key(),
      '@ip' => $_SERVER['SERVER_ADDR'],
    )),
    '#code_height' => '300',
  );
  $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;
}