You are here

function nagios_check_modules in Nagios Monitoring 7

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

Report the number of enabled modules.

Return value

array

File

./nagios.module, line 1138

Code

function nagios_check_modules() {
  $count = (int) db_query("SELECT COUNT(*) FROM {system} WHERE status = :status AND type = :type", [
    ':status' => 1,
    ':type' => 'module',
  ])
    ->fetchField();
  $data = [
    'status' => NAGIOS_STATUS_OK,
    'type' => 'perf',
    'text' => $count,
  ];
  return [
    'key' => 'MOD',
    'data' => $data,
  ];
}