You are here

function nagios_requirements in Nagios Monitoring 7

Same name and namespace in other branches
  1. 6 nagios.install \nagios_requirements()

Implements hook_requirements().

File

./nagios.install, line 29
Install, update and uninstall functions for the nagios module.

Code

function nagios_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {

    // Raise warning if Nagios Unique ID has not been set yet.
    if (variable_get('nagios_ua', '') == '') {
      $requirements['nagios'] = array(
        'title' => t('Nagios module'),
        'value' => t('Not configured'),
        'description' => t('Nagios module has not been configured yet. Please configure its settings from the <a href="@url">Nagios settings page</a>.', array(
          '@url' => url('admin/config/system/nagios'),
        )),
        'severity' => REQUIREMENT_WARNING,
      );
    }

    // Raise warning if core Update module is not enabled.
    if (!module_exists('update')) {
      $requirements['nagios'] = array(
        'title' => t('Nagios module'),
        'value' => t('Update module not enabled'),
        'description' => t('Update notifications are not enabled. Nagios cannot fully complete requirements checks without it. We recommend you enable the update manager module from the <a href="@url">module administration page</a>.', array(
          '@url' => url('admin/modules'),
        )),
        'severity' => REQUIREMENT_WARNING,
      );
    }
  }
  return $requirements;
}