123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- function munin_api_requirements($phase) {
- $ret = array();
- if ($phase == 'runtime') {
- $count = count(module_implements('munin_api_info'));
- switch ($count) {
- case 0:
- $req = array(
- 'title' => t('Munin plugin modules'),
- 'value' => t('No plugin found'),
- 'description' => t('Munin API is enabled, but does not find any plugin, including the one built into the API.'),
- 'severity' => REQUIREMENT_ERROR,
- );
- break;
- case 1:
- $req = array(
- 'title' => t('Munin plugin modules'),
- 'value' => t('No Munin plugin module enabled beyond API'),
- 'description' => t('Munin API is enabled, but no plugin module is enabled to report to it except the one built within the API. You should either <a href="!link">enable some plugin modules</a> or <a href="!link">disable and uninstall Munin API</a>.', array(
- '!link' => url('admin/build/modules'),
- )),
- 'severity' => REQUIREMENT_INFO,
- );
- break;
- default:
- $req = array(
- 'title' => t('Munin plugin modules'),
-
- 'value' => t($count, '1 Munin plugin enabled.',
- '<a href="!link">@count Munin plugins</a> enabled.', array('!link' => url('admin/reports/munin_api'))),
- 'severity' => REQUIREMENT_OK,
- );
- }
- $ret[] = $req;
- }
- elseif ($phase != 'install') {
-
- watchdog('munin_api', 'Invalid phase %phase passed to %function', array(
- '%phase' => $phase,
- '%function' => __FUNCTION__,
- ), WATCHDOG_ERROR);
- }
-
- return $ret;
- }
|