You are here

function drush_nagios_list in Nagios Monitoring 8

Same name and namespace in other branches
  1. 6 nagios.drush.inc \drush_nagios_list()
  2. 7 nagios.drush.inc \drush_nagios_list()

Drush command callback: nagios-list.

File

./nagios.drush.inc, line 38
Provides drush integration for the Nagios module.

Code

function drush_nagios_list() {

  // Invoke hook_nagios_checks() here so people can add in their own checks.
  $moduleHandler = \Drupal::service('module_handler');
  $commands = array_merge($moduleHandler
    ->invokeAll('nagios_checks'), drush_command_invoke_all('nagios_checks'));
  $rows = [];
  foreach ($commands as $cmd => $desc) {
    $rows[] = [
      $cmd,
      $desc,
    ];
  }
  return drush_print_table($rows);
}