Update IOS with 4948 variant hardware detection (#12685)

* Update IOS with 4948 variant hardware detection

* Use entPhysicalModelName if Switch System match
* Add test data for 4948e and 4948-10ge variants

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* Fix bracket error

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* Add json test data

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
This commit is contained in:
Misha Komarovskiy
2021-04-05 23:26:38 +03:00
committed by GitHub
parent 339227280a
commit 61b4c35ab1
5 changed files with 81 additions and 1 deletions

View File

@@ -100,7 +100,7 @@ class Cisco extends OS implements OSDiscovery, ProcessorDiscovery, MempoolsDisco
}
}
if (empty($hardware) && ! empty($data[1000]['entPhysicalModelName'])) {
if ((empty($hardware) || preg_match('/Switch System/', $hardware)) && ! empty($data[1000]['entPhysicalModelName'])) {
$hardware = $data[1000]['entPhysicalModelName'];
} elseif (empty($hardware) && ! empty($data[1000]['entPhysicalContainedIn'])) {
$hardware = $data[$data[1000]['entPhysicalContainedIn']]['entPhysicalName'];