You are here

function monitoring_drush_info_all in Monitoring 7

Provides info about available sensors.

1 call to monitoring_drush_info_all()
monitoring_drush_info in ./monitoring.drush.inc
Drush callback to get available sensors info.

File

./monitoring.drush.inc, line 146
Drush support for monitoring.

Code

function monitoring_drush_info_all() {
  $sensors_info = monitoring_sensor_manager()
    ->getSensorInfo();
  $rows[] = array(
    dt('Label'),
    dt('Name'),
    dt('Category'),
    dt('Enabled'),
  );
  $rows[] = array(
    '----',
    '----',
    '----',
  );

  /** @var \Drupal\monitoring\Sensor\SensorInfo $info */
  foreach ($sensors_info as $name => $info) {
    $rows[] = array(
      $info
        ->getLabel(),
      $name,
      $info
        ->getCategory(),
      $info
        ->isEnabled() ? t('Yes') : t('No'),
    );
  }
  drush_print_table($rows, TRUE);
}