You are here

function _nagios_update_get_available in Nagios Monitoring 7

Wrapper function to ensure update_get_available() can always be accessed, even if the core update module is disabled.

Return value

array Array of data about available releases, keyed by project.

2 calls to _nagios_update_get_available()
drush_nagios_updates in ./nagios.drush.inc
Drush command callback: nagios-updates.
nagios_check_requirements in ./nagios.module
Check all Drupal requirements are satisfied.

File

./nagios.module, line 1337

Code

function _nagios_update_get_available($refresh = FALSE) {
  if (!module_exists('update')) {

    // update_get_available() relies on the update module to have been installed, not just the code to be available
    if (db_table_exists('cache_update')) {
      drupal_load('module', 'update');
      return update_get_available($refresh);
    }
    watchdog('nagios', t('The core update module was never installed so we cannot use update check features.'));
  }
  else {
    return update_get_available($refresh);
  }
  return [];
}