You are here

function performance_nagios in Performance Logging and Monitoring 7

Same name and namespace in other branches
  1. 6.2 performance.module \performance_nagios()
  2. 6 performance.module \performance_nagios()
  3. 7.2 performance.module \performance_nagios()

Implementation of hook_nagios().

File

./performance.module, line 1367
Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com

Code

function performance_nagios() {
  $data = performance_gather_summary_data();
  if (!$data) {
    $info = performance_nagios_info();
    return array(
      $info['id'] => array(
        'status' => NAGIOS_STATUS_UNKNOWN,
        'type' => 'perf',
        'text' => t('Performance logging is not enabled'),
      ),
    );
  }
  $status = NAGIOS_STATUS_OK;
  return array(
    'ACC' => array(
      'status' => $status,
      'type' => 'perf',
      'text' => $data['total_accesses'],
    ),
    'MS' => array(
      'status' => $status,
      'type' => 'perf',
      'text' => $data['ms_avg'],
    ),
    'MMB' => array(
      'status' => $status,
      'type' => 'perf',
      'text' => $data['mb_avg'],
    ),
    'QRC' => array(
      'status' => $status,
      'type' => 'perf',
      'text' => $data['query_count'],
    ),
    'QRT' => array(
      'status' => $status,
      'type' => 'perf',
      'text' => $data['ms_query'],
    ),
  );
}