From f715c2ea9419248ef12b7fdd15c86577729271a6 Mon Sep 17 00:00:00 2001 From: That Guy --^ <9466242+nwautomator@users.noreply.github.com> Date: Mon, 30 Sep 2019 06:45:09 -0400 Subject: [PATCH] add support for per-OS SNMP max repeaters configuration file setting. (#10628) * add support for per-OS SNMP max repeaters configuration file setting. * Simplify function I think it should be equivalent * whitespace... --- includes/snmp.inc.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index 40b8c95910..9c195ba64a 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -1381,15 +1381,8 @@ function snmpwalk_array_num($device, $oid, $indexes = 1) */ function get_device_max_repeaters($device) { - $max_repeaters = $device['snmp_max_repeaters']; - - if (isset($max_repeaters) && $max_repeaters > 0) { - return $max_repeaters; - } elseif (Config::get('snmp.max_repeaters') > 0) { - return Config::get('snmp.max_repeaters'); - } else { - return false; - } + return $device['snmp_max_repeaters'] ?: + Config::getOsSetting($device['os'], 'snmp.max_repeaters', false); } /**