You are here

function monitoring_drush_sensor_config_all in Monitoring 8

Provides info about available sensors.

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

File

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

Code

function monitoring_drush_sensor_config_all() {
  $sensor_config_list = monitoring_sensor_manager()
    ->getAllSensorConfig();
  $rows[] = array(
    dt('Label'),
    dt('Name'),
    dt('Category'),
    dt('Enabled'),
  );
  $rows[] = array(
    '----',
    '----',
    '----',
  );

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