diff --git a/includes/polling/os/iosxr.inc.php b/includes/polling/os/iosxr.inc.php index 61d1dfd3fe..0f6449380b 100644 --- a/includes/polling/os/iosxr.inc.php +++ b/includes/polling/os/iosxr.inc.php @@ -4,6 +4,9 @@ if (preg_match('/^Cisco IOS XR Software \(Cisco ([^\)]+)\),\s+Version ([^\[]+)\[ $hardware = $regexp_result[1]; $features = $regexp_result[3]; $version = $regexp_result[2]; +} elseif (preg_match('/^Cisco IOS XR Software \(([^\)]+)\),\s+Version\s+([^\s]+)/', $device['sysDescr'], $regexp_result)) { + $hardware = $regexp_result[1]; + $version = $regexp_result[2]; } else { // It is not an IOS-XR ... What should we do ? } diff --git a/tests/data/iosxr_ncs5504.json b/tests/data/iosxr_ncs5504.json new file mode 100644 index 0000000000..eadfe37d51 --- /dev/null +++ b/tests/data/iosxr_ncs5504.json @@ -0,0 +1,40 @@ +{ + "os": { + "discovery": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.9.1.2413", + "sysDescr": "Cisco IOS XR Software (NCS-5500), Version 6.6.3 Copyright (c) 2013-2019 by Cisco Systems, Inc.", + "sysContact": null, + "version": null, + "hardware": null, + "features": null, + "os": "iosxr", + "type": "network", + "serial": null, + "icon": "cisco.svg", + "location": null + } + ] + }, + "poller": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.9.1.2413", + "sysDescr": "Cisco IOS XR Software (NCS-5500), Version 6.6.3 Copyright (c) 2013-2019 by Cisco Systems, Inc.", + "sysContact": "", + "version": "6.6.3", + "hardware": "NCS-5504", + "features": null, + "os": "iosxr", + "type": "network", + "serial": null, + "icon": "cisco.svg", + "location": "" + } + ] + } + } +} diff --git a/tests/data/iosxr_ncs5508.json b/tests/data/iosxr_ncs5508.json new file mode 100644 index 0000000000..8730b9cf11 --- /dev/null +++ b/tests/data/iosxr_ncs5508.json @@ -0,0 +1,40 @@ +{ + "os": { + "discovery": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.9.1.2349", + "sysDescr": "Cisco IOS XR Software (NCS-5500), Version 7.0.1 Copyright (c) 2013-2019 by Cisco Systems, Inc.", + "sysContact": null, + "version": null, + "hardware": null, + "features": null, + "os": "iosxr", + "type": "network", + "serial": null, + "icon": "cisco.svg", + "location": null + } + ] + }, + "poller": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.9.1.2349", + "sysDescr": "Cisco IOS XR Software (NCS-5500), Version 7.0.1 Copyright (c) 2013-2019 by Cisco Systems, Inc.", + "sysContact": "", + "version": "7.0.1", + "hardware": "NCS-5508", + "features": null, + "os": "iosxr", + "type": "network", + "serial": null, + "icon": "cisco.svg", + "location": "" + } + ] + } + } +} diff --git a/tests/snmpsim/iosxr_ncs5504.snmprec b/tests/snmpsim/iosxr_ncs5504.snmprec new file mode 100644 index 0000000000..0748552f8a --- /dev/null +++ b/tests/snmpsim/iosxr_ncs5504.snmprec @@ -0,0 +1,9 @@ +1.3.6.1.2.1.1.1.0|4|Cisco IOS XR Software (NCS-5500), Version 6.6.3 Copyright (c) 2013-2019 by Cisco Systems, Inc. +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.2413 +1.3.6.1.2.1.1.3.0|67|148482383 +1.3.6.1.2.1.1.4.0|4| +1.3.6.1.2.1.1.5.0|4| +1.3.6.1.2.1.1.6.0|4| +1.3.6.1.2.1.47.1.1.1.1.13.8384513|4|NCS-5504 +1.3.6.1.2.1.47.1.1.1.1.13.8384518|4|NCS-5504 +1.3.6.1.6.3.10.2.1.3.0|2|1484824 diff --git a/tests/snmpsim/iosxr_ncs5508.snmprec b/tests/snmpsim/iosxr_ncs5508.snmprec new file mode 100644 index 0000000000..dc20314a94 --- /dev/null +++ b/tests/snmpsim/iosxr_ncs5508.snmprec @@ -0,0 +1,9 @@ +1.3.6.1.2.1.1.1.0|4|Cisco IOS XR Software (NCS-5500), Version 7.0.1 Copyright (c) 2013-2019 by Cisco Systems, Inc. +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.2349 +1.3.6.1.2.1.1.3.0|67|731291663 +1.3.6.1.2.1.1.4.0|4| +1.3.6.1.2.1.1.5.0|4| +1.3.6.1.2.1.1.6.0|4| +1.3.6.1.2.1.47.1.1.1.1.13.8384513|4|NCS-5508 +1.3.6.1.2.1.47.1.1.1.1.13.8384518|4|NCS-5508 +1.3.6.1.6.3.10.2.1.3.0|2|7312918