You are here

function nagios_functions in Nagios Monitoring 8

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

Functions to be performed by the base nagios module.

5 calls to nagios_functions()
NagiosCommands::nagios in src/Commands/NagiosCommands.php
Allows querying Drupal's health. Useful for NRPE.
NagiosCommands::nagios_list in src/Commands/NagiosCommands.php
Prints valid checks for `drush nagios`.
nagios_nagios in ./nagios.module
Implements hook_nagios().
nagios_nagios_checks in ./nagios.module
Implements hook_nagios_checks().
nagios_nagios_settings in ./nagios.module
Implements hook_nagios_settings().

File

./nagios.module, line 38
Main file for Nagios service monitoring.

Code

function nagios_functions() {
  $functions = [
    'watchdog' => t('Check recent watchdog entries'),
    'cron' => t('Check whether cron has been running regularly'),
    'session_anon' => t('Check the number of anonymous sessions for nagios performance data'),
    'session_auth' => t('Check the number of authenticated sessions for nagios performance data'),
    'users' => t('Check the number of users for nagios performance data'),
    'modules' => t('Check the number of modules for nagios performance data'),
    'themes' => t('Check the number of themes for nagios performance data'),
    'maintenance' => t('Check if maintenance mode is not active (site is online).'),
  ];
  $moduleHandler = Drupal::moduleHandler();
  if ($moduleHandler
    ->moduleExists('update')) {
    $functions['requirements'] = t('Checking of hook_requirements. This includes the following: module updates, database schema, files directory writability, update.php protected, Lots of other good stuff ...');
  }
  if ($moduleHandler
    ->moduleExists('node')) {
    $functions['nodes'] = t('Check the number of nodes for nagios performance data');
  }
  if ($moduleHandler
    ->moduleExists('elysia_cron')) {
    $functions['elysia_cron'] = t('Check whether elysia cron has been running regularly');
  }
  return $functions;
}