mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -737,6 +737,25 @@ function round_Nth($val = 0, $round_to) {
|
|||||||
} // end round_Nth
|
} // 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
|
* FIXME: Dummy implementation
|
||||||
*/
|
*/
|
||||||
|
@@ -1211,24 +1211,6 @@ function load_device_mibs($device)
|
|||||||
} // load_device_mibs
|
} // 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.
|
* Run MIB-based polling for $device. Update $graphs with the results.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user