From 6d1dce8c58bf1abe0da15ce0d4b8a223b498b214 Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Tue, 3 May 2016 02:14:35 +1000 Subject: [PATCH] Allow of MIB polling for individual devices --- includes/common.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/includes/common.php b/includes/common.php index ee8d16b24..1a7c817b8 100644 --- a/includes/common.php +++ b/includes/common.php @@ -488,7 +488,7 @@ function get_dev_attrib($device, $attrib_type, $attrib_value='') { function is_dev_attrib_enabled($device, $attrib, $default = true) { $val = get_dev_attrib($device, $attrib); - if ($val != NULL) { + if ($val != null) { // attribute is set return ($val != 0); } @@ -753,16 +753,11 @@ function round_Nth($val = 0, $round_to) { */ function is_mib_poller_enabled($device) { - if (is_dev_attrib_enabled($device, 'poll_mib')) { - d_echo('MIB module enabled for '.$device['hostname']."\n"); - return true; + $val = get_dev_attrib($device, 'poll_mib'); + if ($val == null) { + return is_module_enabled('poller', 'mib'); } - - if (is_module_enabled('poller', 'mib')) { - return true; - } - - return false; + return $val; } // is_mib_poller_enabled