12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- // $Id$
- /**
- * @file
- * Munin API for Drupal: installation and runtime checks.
- *
- * @author Frederic G. MARAND
- *
- * @copyright (c) 2011 Ouest Systèmes Informatiques
- *
- * Licensed under the General Public License version 2 or later.
- */
- /**
- * Implements hook_requirements().
- */
- function munin_api_requirements($phase) {
- $ret = array();
- if ($phase == 'runtime') {
- $count = count(module_implements('munin_api_info'));
- if ($count == 0) {
- $req = array(
- 'title' => t('Munin plugin modules'),
- 'value' => t('No Munin plugin module enabled'),
- 'description' => t('Munin API is enabled, but no plugin module is enabled to report to it. In this situation, Munin API consumes resources but does not actually report anything. You should either enable some plugin modules or disable and uninstall Munin API.'),
- 'severity' => REQUIREMENT_WARNING,
- );
- }
- else {
- $req = array(
- 'title' => t('Munin plugin modules'),
- 'value' => format_plural($count, '1 Munin plugin enabled.',
- '@count Munin plugins enabled.'),
- 'severity' => REQUIREMENT_OK,
- );
- }
- $ret[] = $req;
- }
- elseif ($phase != 'install') {
- // This should never happen and points to a severe error somewhere
- watchdog('munin_api', 'Invalid phase %phase passed to %function', array(
- '%phase' => $phase,
- '%function' => __FUNCTION__,
- ), WATCHDOG_ERROR);
- }
- // else $phase == 'install', nothing to do.
- return $ret;
- }
|