You are here

function monitoring_monitoring_sensor_info in Monitoring 7

Implements hook_monitoring_sensor_info().

Module unspecific sensors:

  • git
  • disappearing sensors

File

./monitoring.monitoring_sensors.inc, line 22
Define default sensors for core and contrib modules.

Code

function monitoring_monitoring_sensor_info() {
  $info['monitoring_git_dirty_tree'] = array(
    'label' => 'Git dirty working tree',
    'description' => 'Repository local file changes',
    'sensor_class' => 'Drupal\\monitoring\\Sensor\\Sensors\\SensorGitDirtyTree',
    'settings' => array(
      'category' => 'System',
      // Disabled by default as we cannot know if the sensor is running in a
      // source base managed by git.
      'enabled' => FALSE,
      // Path of the repository relative to the Drupal root. Set to NULL if
      // the repository root is the same as Drupal root.
      'repo_path' => NULL,
      'status_cmd' => 'git status --porcelain',
      'check_branch' => FALSE,
      'ahead_cmd' => "git log --graph --pretty=format:'%h -%d %s (%ci)' @{u}..",
      'branches_cmd' => 'git rev-parse --symbolic --branches',
      'actual_branch_cmd' => 'git symbolic-ref HEAD --short',
      'expected_branch' => NULL,
      'submodules_cmd' => 'git submodule status --recursive',
    ),
  );
  $info['monitoring_disappeared_sensors'] = array(
    'label' => 'Disappeared sensors',
    'description' => 'Keeps track of active sensors and reports if a sensor disappears',
    'sensor_class' => 'Drupal\\monitoring\\Sensor\\Sensors\\SensorDisappearedSensors',
    'settings' => array(
      'category' => 'System',
    ),
  );
  return $info;
}