mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix regression on HW discovery for Cisco Catalyst chassis (#10877)
* Catalyst fix for HW * Try to avoid issue with stacks, chassis or standalone boxes * formatCiscoHardware iosxe for humans * codeclimate
This commit is contained in:
@@ -193,6 +193,18 @@ class Rewrite
|
||||
}
|
||||
}
|
||||
|
||||
if ($device['os'] == "iosxe") {
|
||||
if ($device['hardware']) {
|
||||
if (preg_match('/CAT9K/', $device['sysDescr'], $matches) && preg_match("/^C(9[A-Za-z0-9]+)/", $device['hardware'], $matches2)) {
|
||||
if (!$short) {
|
||||
$device['hardware'] = "Catalyst " . $matches2[1] . " (" . $device['hardware'] . ")";
|
||||
} else {
|
||||
$device['hardware'] = "Catalyst " . $matches2[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $device['hardware'];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user