You are here

monitoring_demo.module in Monitoring 7

Bootstrap file of the monitoring_demo module.

File

test/monitoring_demo.module
View source
<?php

/**
 * @file
 *   Bootstrap file of the monitoring_demo module.
 */

/**
 * Implements hook_menu().
 */
function monitoring_demo_menu() {
  $menu['monitoring-demo'] = array(
    'title' => 'Monitoring demo',
    'description' => 'Monitoring demo landing page with basic links and info.',
    'page callback' => 'monitoring_demo_page',
    'access callback' => TRUE,
  );
  return $menu;
}

/**
 * Page callback of the demo landing page.
 */
function monitoring_demo_page() {
  return array(
    'intro' => array(
      '#markup' => '<p>' . t('Welcome to the Monitoring demo installation. Content and log messages (including dummy errors) have been generated automatically to demonstrate different sensors and their escalation.'),
    ),
    'report' => array(
      '#type' => 'item',
      '#title' => l(t('Monitoring sensors overview'), 'admin/reports/monitoring'),
      '#description' => t('Basic dashboard showing the sensor list with their status and information.'),
    ),
    'configuration' => array(
      '#type' => 'item',
      '#title' => l(t('Monitoring sensors settings'), 'admin/config/system/monitoring'),
      '#description' => t('Monitoring sensors configuration page. See this page for the complete list of the available sensors.'),
    ),
    'sensor_enabled_modules' => array(
      '#type' => 'item',
      '#title' => t('Sensor example: "Enabled modules"'),
      '#description' => t('Monitors which modules are supposed to be enabled. In case there is a needed module disabled or excess module enabled you will be noticed.') . theme('item_list', array(
        'items' => array(
          t('<a href="@url">Configure</a> the module by submitting the default settings.', array(
            '@url' => url('admin/config/system/monitoring/sensors/monitoring_enabled_modules'),
          )),
          t('<a href="@url">Disable</a> Dashboard module and enable Book module.', array(
            '@url' => url('admin/modules'),
          )),
          t('Visit the <a href="@url">sensors overview page</a> to see the reported issue.', array(
            '@url' => url('admin/reports/monitoring'),
          )),
        ),
      )),
    ),
    'sensor_disappeared_sensors' => array(
      '#type' => 'item',
      '#title' => t('Sensor example: "Disappeared sensors"'),
      '#description' => t('Additionally to disabling modules, configuration changes like removing content types or search API indexes could lead to sensors that silently disappear.') . theme('item_list', array(
        'items' => array(
          t('<a href="@url">Delete</a> a search API index, which makes the corresponding sensor disappear.', array(
            '@url' => url('admin/config/search/search_api'),
          )),
          t('Visit the <a href="@url">sensors overview page</a> to see the sensor reporting disappeared sensors.', array(
            '@url' => url('admin/reports/monitoring'),
          )),
        ),
      )),
    ),
  );
}

Functions

Namesort descending Description
monitoring_demo_menu Implements hook_menu().
monitoring_demo_page Page callback of the demo landing page.