From a5fec082e7af3115548320a7e544face641e0bad Mon Sep 17 00:00:00 2001 From: Peter Reinhold <55623+FlyveHest@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:46:28 +0100 Subject: [PATCH] Updated SLA poller for Cisco Nexus 9000 (#15855) * Handled rttMonLatestJitterOperPacketOutOfSequence and rttMonLatestJitterOperPacketMIA not being present on Cisco Nexus9000 routers by defaulting to null value when not found. Non-existance of OIDs confirmed here: https://cisco.github.io/cisco-mibs/supportlists/nexus9000/Nexus9000MIBSupportList.html * Added snmp test data * Removed superfluous comments * Fixed sla number in test data * Removed spacing * Removed ? --- LibreNMS/OS/Shared/Cisco.php | 4 +- tests/data/nxos_n9000-9.3.9.json | 19 +++++++++ tests/snmpsim/nxos_n9000-9.3.9.snmprec | 59 ++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tests/data/nxos_n9000-9.3.9.json create mode 100644 tests/snmpsim/nxos_n9000-9.3.9.snmprec diff --git a/LibreNMS/OS/Shared/Cisco.php b/LibreNMS/OS/Shared/Cisco.php index cdec3a08cc..75359790fd 100755 --- a/LibreNMS/OS/Shared/Cisco.php +++ b/LibreNMS/OS/Shared/Cisco.php @@ -449,8 +449,8 @@ class Cisco extends OS implements $jitter = [ 'PacketLossSD' => $data[$sla_nr]['rttMonLatestJitterOperPacketLossSD'], 'PacketLossDS' => $data[$sla_nr]['rttMonLatestJitterOperPacketLossDS'], - 'PacketOutOfSequence' => $data[$sla_nr]['rttMonLatestJitterOperPacketOutOfSequence'], - 'PacketMIA' => $data[$sla_nr]['rttMonLatestJitterOperPacketMIA'], + 'PacketOutOfSequence' => $data[$sla_nr]['rttMonLatestJitterOperPacketOutOfSequence'] ?? null, + 'PacketMIA' => $data[$sla_nr]['rttMonLatestJitterOperPacketMIA'] ?? null, 'PacketLateArrival' => $data[$sla_nr]['rttMonLatestJitterOperPacketLateArrival'], 'MOS' => isset($data[$sla_nr]['rttMonLatestJitterOperMOS']) ? intval($data[$sla_nr]['rttMonLatestJitterOperMOS']) / 100 : null, 'ICPIF' => $data[$sla_nr]['rttMonLatestJitterOperICPIF'] ?? null, diff --git a/tests/data/nxos_n9000-9.3.9.json b/tests/data/nxos_n9000-9.3.9.json new file mode 100644 index 0000000000..ff1ed41312 --- /dev/null +++ b/tests/data/nxos_n9000-9.3.9.json @@ -0,0 +1,19 @@ +{ + "slas": { + "discovery": { + "slas": [ + { + "sla_nr": 101, + "owner": "", + "tag": "SLA1", + "rtt_type": "jitter", + "rtt": 1, + "status": 1, + "opstatus": 0, + "deleted": 0 + } + ] + }, + "poller": "matches discovery" + } +} diff --git a/tests/snmpsim/nxos_n9000-9.3.9.snmprec b/tests/snmpsim/nxos_n9000-9.3.9.snmprec new file mode 100644 index 0000000000..ced42eccf7 --- /dev/null +++ b/tests/snmpsim/nxos_n9000-9.3.9.snmprec @@ -0,0 +1,59 @@ +1.3.6.1.2.1.1.1.0|4|Cisco NX-OS(tm) Nexus9000 C93180YC-FX3, Software (NXOS 32-bit), Version 9.3(9), RELEASE SOFTWARE Copyright (c) 2002-2022 by Cisco Systems, Inc. Compiled 2/4/2022 7:00:00 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.12.3.1.3.2193 +1.3.6.1.4.1.9.9.42.1.2.1.1.2.101|4| +1.3.6.1.4.1.9.9.42.1.2.1.1.3.101|4|SLA1 +1.3.6.1.4.1.9.9.42.1.2.1.1.4.101|2|9 +1.3.6.1.4.1.9.9.42.1.2.1.1.5.101|2|5000 +1.3.6.1.4.1.9.9.42.1.2.1.1.6.101|2|60 +1.3.6.1.4.1.9.9.42.1.2.1.1.7.101|2|5000 +1.3.6.1.4.1.9.9.42.1.2.1.1.8.101|2|2 +1.3.6.1.4.1.9.9.42.1.2.1.1.9.101|2|1 +1.3.6.1.4.1.9.9.42.1.2.1.1.10.101|2|1 +1.3.6.1.4.1.9.9.42.1.2.2.1.1.101|2|27 +1.3.6.1.4.1.9.9.42.1.2.2.1.2.101|4x|64400502 +1.3.6.1.4.1.9.9.42.1.2.2.1.3.101|2|32 +1.3.6.1.4.1.9.9.42.1.2.2.1.5.101|2|4000 +1.3.6.1.4.1.9.9.42.1.2.2.1.6.101|4x|64400A02 +1.3.6.1.4.1.9.9.42.1.2.2.1.7.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.2.1.8.101|2|1 +1.3.6.1.4.1.9.9.42.1.2.2.1.9.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.2.1.11.101|4| +1.3.6.1.4.1.9.9.42.1.2.2.1.12.101|4| +1.3.6.1.4.1.9.9.42.1.2.2.1.17.101|2|20 +1.3.6.1.4.1.9.9.42.1.2.2.1.18.101|2|10 +1.3.6.1.4.1.9.9.42.1.2.2.1.20.101|4| +1.3.6.1.4.1.9.9.42.1.2.2.1.26.101|4|mpls +1.3.6.1.4.1.9.9.42.1.2.2.1.27.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.2.1.28.101|2|20 +1.3.6.1.4.1.9.9.42.1.2.2.1.29.101|2|32 +1.3.6.1.4.1.9.9.42.1.2.2.1.30.101|2|10 +1.3.6.1.4.1.9.9.42.1.2.2.1.31.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.2.1.77.101|66|0 +1.3.6.1.4.1.9.9.42.1.2.2.1.78.101|66|0 +1.3.6.1.4.1.9.9.42.1.2.2.1.79.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.5.1.1.101|2|2147483647 +1.3.6.1.4.1.9.9.42.1.2.5.1.2.101|67|1 +1.3.6.1.4.1.9.9.42.1.2.5.1.3.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.5.1.4.101|2|2 +1.3.6.1.4.1.9.9.42.1.2.7.1.1.101|2|2 +1.3.6.1.4.1.9.9.42.1.2.7.1.4.101|2|1 +1.3.6.1.4.1.9.9.42.1.2.7.1.5.101|2|20 +1.3.6.1.4.1.9.9.42.1.2.8.1.1.101|2|0 +1.3.6.1.4.1.9.9.42.1.2.8.1.2.101|2|15 +1.3.6.1.4.1.9.9.42.1.2.8.1.4.101|2|1 +1.3.6.1.4.1.9.9.42.1.2.9.1.3.101|67|4294959371 +1.3.6.1.4.1.9.9.42.1.2.9.1.9.101|2|2147483647 +1.3.6.1.4.1.9.9.42.1.2.9.1.10.101|2|6 +1.3.6.1.4.1.9.9.42.1.2.10.1.1.101|66|1 +1.3.6.1.4.1.9.9.42.1.2.10.1.2.101|2|1 +1.3.6.1.4.1.9.9.42.1.2.10.1.5.101|67|411815897 +1.3.6.1.4.1.9.9.42.1.5.2.1.1.101|66|10 +1.3.6.1.4.1.9.9.42.1.5.2.1.26.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.27.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.30.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.41.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.42.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.43.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.49.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.50.101|66|0 +1.3.6.1.4.1.9.9.42.1.5.2.1.51.101|2|0