Fix Cisco SLAs garbage entries (#13068)

* Fix Cisco SLAs garbage entries
Resulting from extra data returned by device not in the exisitng MIB... Updated the MIB too.
Thanks https://community.librenms.org/t/cisco-ip-sla-issues/16429

* Add test data
This commit is contained in:
Tony Murray
2021-07-25 04:23:04 -05:00
committed by GitHub
parent 747506172a
commit ae2b761e94
4 changed files with 3524 additions and 1480 deletions

View File

@@ -317,11 +317,15 @@ class Cisco extends OS implements OSDiscovery, SlaDiscovery, ProcessorDiscovery,
}
foreach ($sla_data as $index => $sla_config) {
if (empty($sla_config['rttMonCtrlAdminRttType'])) {
continue; // skip garbage entries
}
$slas->push(new Sla([
'sla_nr' => $index,
'owner' => $sla_config['rttMonCtrlAdminOwner'] ?? '',
'tag' => $this->getSlaTag($sla_config),
'rtt_type' => $sla_config['rttMonCtrlAdminRttType'] ?? '',
'rtt_type' => $sla_config['rttMonCtrlAdminRttType'],
'rtt' => $sla_config['rttMonLatestRttOperCompletionTime'] ?? null,
'status' => ($sla_config['rttMonCtrlAdminStatus'] == 'active') ? 1 : 0,
'opstatus' => ($sla_config['rttMonLatestRttOperSense'] == 'ok') ? 0 : 2,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "",
"sysObjectID": ".1.3.6.1.4.1.9.1.615",
"sysDescr": "Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3)\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2017 by Cisco Systems, Inc.\r\nCompiled Sat 19-Aug-17 09:21 by prod_rel_team",
"sysContact": null,
"version": "15.0(2)SE11",
"hardware": "catalyst3560G24TS",
"features": "IPSERVICESK9",
"os": "ios",
"type": "network",
"serial": null,
"icon": "cisco.svg",
"location": null
}
]
},
"poller": "matches discovery"
},
"slas": {
"discovery": {
"slas": [
{
"sla_nr": 10,
"owner": "",
"tag": "192.168.168.182",
"rtt_type": "echo",
"rtt": 16,
"status": 1,
"opstatus": 0,
"deleted": 0
}
]
},
"poller": "matches discovery"
}
}

View File

@@ -0,0 +1,120 @@
1.3.6.1.2.1.1.1.0|4x|436973636f20494f5320536f6674776172652c20433335363020536f667477617265202843333536302d495053455256494345534b392d4d292c2056657273696f6e2031352e30283229534531312c2052454c4541534520534f4654574152452028666333290a546563686e6963616c20537570706f72743a20687474703a2f2f7777772e636973636f2e636f6d2f74656368737570706f72740d0a436f707972696768742028632920313938362d3230313720627920436973636f2053797374656d732c20496e632e0d0a436f6d70696c6564205361742031392d4175672d31372030393a32312062792070726f645f72656c5f7465616d
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.615
1.3.6.1.2.1.1.3.0|67|2129157527
1.3.6.1.2.1.1.5.0|4|
1.3.6.1.4.1.9.9.42.1.2.1.1.2.10|4|
1.3.6.1.4.1.9.9.42.1.2.1.1.3.10|4|
1.3.6.1.4.1.9.9.42.1.2.1.1.4.10|2|1
1.3.6.1.4.1.9.9.42.1.2.1.1.5.10|2|1000
1.3.6.1.4.1.9.9.42.1.2.1.1.6.10|2|2
1.3.6.1.4.1.9.9.42.1.2.1.1.7.10|2|1000
1.3.6.1.4.1.9.9.42.1.2.1.1.8.10|2|1
1.3.6.1.4.1.9.9.42.1.2.1.1.9.10|2|1
1.3.6.1.4.1.9.9.42.1.2.1.1.10.10|2|1
1.3.6.1.4.1.9.9.42.1.2.1.1.11.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.1.10|2|2
1.3.6.1.4.1.9.9.42.1.2.2.1.2.10|4x|C0A8A8B6
1.3.6.1.4.1.9.9.42.1.2.2.1.3.10|2|10000
1.3.6.1.4.1.9.9.42.1.2.2.1.4.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.5.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.6.10|4x|C0A8A8B1
1.3.6.1.4.1.9.9.42.1.2.2.1.7.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.8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.1.9.9.42.1.2.2.1.39.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.40.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.41.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.42.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.43.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.44.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.45.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.46.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.47.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.48.10|2|2
1.3.6.1.4.1.9.9.42.1.2.2.1.49.10|66|0
1.3.6.1.4.1.9.9.42.1.2.2.1.50.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.51.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.52.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.53.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.54.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.55.10|2|2
1.3.6.1.4.1.9.9.42.1.2.2.1.56.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.57.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.58.10|2|3
1.3.6.1.4.1.9.9.42.1.2.2.1.59.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.60.10|4x|00000000
1.3.6.1.4.1.9.9.42.1.2.2.1.61.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.62.10|4|
1.3.6.1.4.1.9.9.42.1.2.2.1.63.10|2|0
1.3.6.1.4.1.9.9.42.1.2.2.1.64.10|4x|000000000000
1.3.6.1.4.1.9.9.42.1.2.2.1.65.10|4x|000000000000
1.3.6.1.4.1.9.9.42.1.2.2.1.66.10|66|0
1.3.6.1.4.1.9.9.42.1.2.5.1.1.10|2|2147483647
1.3.6.1.4.1.9.9.42.1.2.5.1.2.10|67|1
1.3.6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