is_mib_poller_enabled() needs to be in common.php for code paths that don't use includes/snmp.inc.php (e.g. graph.php)

This commit is contained in:
Paul Gear
2016-01-07 09:38:32 +10:00
parent 7170a240a8
commit f672a8e12e
2 changed files with 19 additions and 18 deletions

View File

@@ -737,6 +737,25 @@ function round_Nth($val = 0, $round_to) {
} // end round_Nth
/*
* @return true if this device should be polled with MIB-based discovery
*/
function is_mib_poller_enabled($device)
{
if (!is_module_enabled('poller', 'mib')) {
d_echo("MIB polling module disabled globally.\n");
return false;
}
if (!is_dev_attrib_enabled($device, 'poll_mib')) {
d_echo('MIB module disabled for '.$device['hostname']."\n");
return false;
}
return true;
} // is_mib_poller_enabled
/*
* FIXME: Dummy implementation
*/

View File

@@ -1211,24 +1211,6 @@ function load_device_mibs($device)
} // load_device_mibs
/*
* @return true if this device should be polled with MIB-based discovery
*/
function is_mib_poller_enabled($device)
{
if (!is_module_enabled('poller', 'mib')) {
d_echo("MIB polling module disabled globally.\n");
return false;
}
if (!is_dev_attrib_enabled($device, 'poll_mib')) {
d_echo('MIB module disabled for '.$device['hostname']."\n");
return false;
}
return true;
} // is_mib_poller_enabled
/*
* Run MIB-based polling for $device. Update $graphs with the results.
*/