From 5e9e1e9c9504f430920a7de70fe5b2136e967eec Mon Sep 17 00:00:00 2001 From: Shane Mc Cormack Date: Tue, 10 Sep 2024 20:54:52 +0100 Subject: [PATCH] Fix detecting stacks in unstacked switches. (#16384) Fix #16374 --- includes/discovery/sensors/state/cisco.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/sensors/state/cisco.inc.php b/includes/discovery/sensors/state/cisco.inc.php index 8619064727..8b5ee3b1eb 100644 --- a/includes/discovery/sensors/state/cisco.inc.php +++ b/includes/discovery/sensors/state/cisco.inc.php @@ -40,7 +40,7 @@ $repsegmentnumber = 0; foreach ($tables as $tablevalue) { //Some switches on 15.x expose this information regardless if they are stacked or not, we try to mitigate that by doing the following. - if (($tablevalue['oid'] == 'cswGlobals' || $tablevalue['oid'] == 'cswSwitchRole' || $tablevalue['oid'] == 'cswSwitchState' || $tablevalue['oid'] == 'cswStackPortOperStatus') && $redundant_data == 'false' && count($role_data) <= 1) { + if (in_array($tablevalue['oid'], ['CISCO-STACKWISE-MIB::cswGlobals', 'CISCO-STACKWISE-MIB::cswSwitchRole', 'CISCO-STACKWISE-MIB::cswSwitchState', 'CISCO-STACKWISE-MIB::cswStackPortOperStatus']) && $redundant_data == 'false' && count($role_data) <= 1) { continue; }