From f672a8e12e502909e07e9f0cadaa862a86ad8121 Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Thu, 7 Jan 2016 09:38:32 +1000 Subject: [PATCH] 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) --- includes/common.php | 19 +++++++++++++++++++ includes/snmp.inc.php | 18 ------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/includes/common.php b/includes/common.php index 891ed1a0b..780082a0c 100644 --- a/includes/common.php +++ b/includes/common.php @@ -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 */ diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index cb83d8068..6d1c32238 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -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. */