Skip to content

Commit 01ecff8

Browse files
committed
Add support for ArubaOS switch
1 parent 8f49f2b commit 01ecff8

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

lib/nelsnmp/hostinfo/collect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from nelsnmp.vendors.arista.versions import AristaVersion
44
from nelsnmp.vendors.cisco.versions import CiscoVersion
55
from nelsnmp.vendors.ericsson.versions import EricssonVersion
6+
from nelsnmp.vendors.hpe.versions import HpeVersion
67
from nelsnmp.vendors.huawei.versions import HuaweiVersion
78
from nelsnmp.vendors.juniper.versions import JuniperVersion
89
from nelsnmp.vendors.metamako.versions import MetamakoVersion
@@ -25,6 +26,8 @@ def get_device_version(**kwargs):
2526
return CiscoVersion(**kwargs)
2627
if vendor == 'ericsson':
2728
return EricssonVersion(**kwargs)
29+
elif vendor == 'hpe':
30+
return HpeVersion(**kwargs)
2831
elif vendor == 'huawei':
2932
return HuaweiVersion(**kwargs)
3033
elif vendor == 'juniper':

lib/nelsnmp/vendors/hpe/__init__.py

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from nelsnmp.hostinfo.version import DeviceVersion
2+
3+
4+
class HpeVersion(DeviceVersion):
5+
6+
def _get_version(self):
7+
for line in self._descriptions:
8+
if 'Aruba' in line and "Switch" in line:
9+
self.os = 'arubaos-switch'
10+
parts = line.split()
11+
if len(parts) > 6:
12+
if parts[4] == 'revision':
13+
self.version = parts[5].split(',')[0]

lib/nelsnmp/vendors/mappings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
vendor_map = {}
33
vendor_map['9'] = 'cisco'
4+
vendor_map['11'] = 'hpe'
45
vendor_map['2011'] = 'huawei'
56
vendor_map['2352'] = 'ericsson'
67
vendor_map['2636'] = 'juniper'

tests/valid_hostinfo_files/hpe.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
arubaos01:
3+
sysobjectid: 1.3.6.1.4.1.11.2.3.7.8.5.4
4+
description: "Aruba 3810M Switch Stack, revision KB.16.04.0009, ROM KB.16.01.0008 (/ws/swbuildm/rel_ukiah_qaoff/code/build/bom(swbuildm_rel_ukiah_qaoff_rel_ukiah))"
5+
vendor: hpe
6+
os: arubaos-switch
7+
version: KB.16.04.0009

0 commit comments

Comments
 (0)