From 385ef98ff72520623b62174e64263b5d5ce515b1 Mon Sep 17 00:00:00 2001 From: wuwei <24752677+imwuwei@users.noreply.github.com> Date: Wed, 14 Apr 2021 23:11:51 +0800 Subject: [PATCH] Parse info from H3C branded comware devices (#12551) * Update comware.yaml Fix the problem that the H3C switch cannot obtain the device hardware model * better regex, remove ENTITY-MIB::entPhysicalName it is rubbish. Co-authored-by: Tony Murray --- includes/definitions/discovery/comware.yaml | 2 +- tests/data/comware.json | 6 +++--- tests/data/comware_a5500.json | 2 +- tests/data/comware_hpe5900.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/definitions/discovery/comware.yaml b/includes/definitions/discovery/comware.yaml index 751ec18a46..80560f0604 100644 --- a/includes/definitions/discovery/comware.yaml +++ b/includes/definitions/discovery/comware.yaml @@ -1,7 +1,7 @@ mib: HH3C-LswDEVM-MIB:HH3C-ENTITY-EXT-MIB modules: os: - sysDescr_regex: '/Version (?[0-9.]+).*(Release|ESS) (?[R0-9P]+).*\n(HPE |HPE FF |HP )(?.*)/' + sysDescr_regex: '/Version (?[0-9.]+).*(Release|ESS) (?[R0-9P]+).*[\n ](HPE |HPE FF |HP |H3C )(?.*)[\r ][\n ]/' sensors: pre-cache: data: diff --git a/tests/data/comware.json b/tests/data/comware.json index 476fa9ac52..aa23828597 100644 --- a/tests/data/comware.json +++ b/tests/data/comware.json @@ -49765,9 +49765,9 @@ "sysObjectID": ".1.3.6.1.4.1.25506.11.1.172", "sysDescr": "HP Comware Platform Software, Software Version 7.1.045, Release 2416 HP FF 5700-40XG-2QSFP Switch Copyright (c) 2010-2014 Hewlett-Packard Development Company, L.P.", "sysContact": "", - "version": null, - "hardware": null, - "features": null, + "version": "7.1.045", + "hardware": "FF 5700-40XG-2QSFP", + "features": "2416", "os": "comware", "type": "network", "serial": "DM20F3000F", diff --git a/tests/data/comware_a5500.json b/tests/data/comware_a5500.json index 2be69151a4..59e5c9c0b6 100644 --- a/tests/data/comware_a5500.json +++ b/tests/data/comware_a5500.json @@ -8,7 +8,7 @@ "sysDescr": "HP Comware Platform Software, Software Version 5.20.99 Release 2222P08\nHP A5500-24G EI Switch with 2 Interface Slots\r\nCopyright (c) 2010-2017 Hewlett Packard Enterprise Development LP", "sysContact": "", "version": "5.20.99", - "hardware": "A5500-24G EI Switch with 2 Interface Slots\r", + "hardware": "A5500-24G EI Switch with 2 Interface Slots", "features": "2222P08", "os": "comware", "type": "network", diff --git a/tests/data/comware_hpe5900.json b/tests/data/comware_hpe5900.json index 7013f752fd..b339bd742f 100644 --- a/tests/data/comware_hpe5900.json +++ b/tests/data/comware_hpe5900.json @@ -26,7 +26,7 @@ "sysDescr": "HPE Comware Platform Software, Software Version 7.1.045, Release 2422P01\nHPE 5900AF-48G-4XG-2QSFP+ Switch\r\nCopyright (c) 2010-2015 Hewlett Packard Enterprise Development LP", "sysContact": "", "version": "7.1.045", - "hardware": "5900AF-48G-4XG-2QSFP+ Switch\r", + "hardware": "5900AF-48G-4XG-2QSFP+ Switch", "features": "2422P01", "os": "comware", "type": "network",