From 5f8b41d4bac4ca6f000d2be44a6c86f63a6b91e7 Mon Sep 17 00:00:00 2001 From: Nocturr <50491368+Nocturr@users.noreply.github.com> Date: Thu, 28 Oct 2021 01:52:58 +0200 Subject: [PATCH] UniFi/EdgeSwitch OS support for fw 5.x (#13434) * Fix support for fw 5.x * Add test data --- .../definitions/discovery/edgeswitch.yaml | 2 +- tests/data/edgeswitch_us-24-250w.json | 23 +++++++++++++++++++ tests/snmpsim/edgeswitch_us-24-250w.snmprec | 5 ++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tests/data/edgeswitch_us-24-250w.json create mode 100644 tests/snmpsim/edgeswitch_us-24-250w.snmprec diff --git a/includes/definitions/discovery/edgeswitch.yaml b/includes/definitions/discovery/edgeswitch.yaml index f2d0a47f6a..99df944ebf 100644 --- a/includes/definitions/discovery/edgeswitch.yaml +++ b/includes/definitions/discovery/edgeswitch.yaml @@ -7,7 +7,7 @@ modules: free: EdgeSwitch-SWITCHING-MIB::agentSwitchCpuProcessMemFree precision: 1024 os: - sysDescr_regex: '/^(?EdgeSwitch .*|EdgePoint Switch .*|USW-.*), (?.*), Linux .*$/' + sysDescr_regex: '/^(?EdgeSwitch .*|EdgePoint Switch .*|USW-.*|US-.*), (?.*), Linux .*$/' serial: ENTITY-MIB::entPhysicalSerialNum.1 sensors: state: diff --git a/tests/data/edgeswitch_us-24-250w.json b/tests/data/edgeswitch_us-24-250w.json new file mode 100644 index 0000000000..8e18a636ee --- /dev/null +++ b/tests/data/edgeswitch_us-24-250w.json @@ -0,0 +1,23 @@ +{ + "os": { + "discovery": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.4413", + "sysDescr": "US-24-250W, 5.43.18.12487, Linux 3.6.5", + "sysContact": null, + "version": "5.43.18.12487", + "hardware": "US-24-250W", + "features": null, + "os": "edgeswitch", + "type": "network", + "serial": null, + "icon": "ubiquiti.svg", + "location": null + } + ] + }, + "poller": "matches discovery" + } +} diff --git a/tests/snmpsim/edgeswitch_us-24-250w.snmprec b/tests/snmpsim/edgeswitch_us-24-250w.snmprec new file mode 100644 index 0000000000..a1866ee4e9 --- /dev/null +++ b/tests/snmpsim/edgeswitch_us-24-250w.snmprec @@ -0,0 +1,5 @@ +1.3.6.1.2.1.1.1.0|4|US-24-250W, 5.43.18.12487, Linux 3.6.5 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.4413 +1.3.6.1.4.1.4413.1.1.1.1.1.1.0|4|US-24-250W, 5.43.18.12487, Linux 3.6.5 +1.3.6.1.4.1.4413.1.1.1.1.1.2.0|4|US-24-250W +1.3.6.1.4.1.4413.1.1.1.1.1.3.0|4|US24P250