Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ArubaOS switch #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/nelsnmp/hostinfo/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from nelsnmp.vendors.arista.versions import AristaVersion
from nelsnmp.vendors.cisco.versions import CiscoVersion
from nelsnmp.vendors.ericsson.versions import EricssonVersion
from nelsnmp.vendors.hpe.versions import HpeVersion
from nelsnmp.vendors.huawei.versions import HuaweiVersion
from nelsnmp.vendors.juniper.versions import JuniperVersion
from nelsnmp.vendors.metamako.versions import MetamakoVersion
Expand All @@ -22,12 +23,14 @@ def get_device_version(**kwargs):
vendors['arista'] = AristaVersion
vendors['cisco'] = CiscoVersion
vendors['ericsson'] = EricssonVersion
vendors['hpe'] = HpeVersion
vendors['huawei'] = HuaweiVersion
vendors['juniper'] = JuniperVersion
vendors['metamako'] = MetamakoVersion

if vendor in vendors:
return vendors[vendor](**kwargs)

elif vendor == 'net-snmp':
if 'snmp' in kwargs.keys():
found_vendor = get_netsnmp_device_vendor(kwargs['snmp'])
Expand Down
Empty file.
13 changes: 13 additions & 0 deletions lib/nelsnmp/vendors/hpe/versions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from nelsnmp.hostinfo.version import DeviceVersion


class HpeVersion(DeviceVersion):

def _get_version(self):
for line in self._descriptions:
if (('Aruba' in line and "Switch" in line) or 'revision KB.16.04.' in line):
self.os = 'arubaos-switch'
parts = line.split()
if len(parts) > 6:
if parts[4] == 'revision':
self.version = parts[5].split(',')[0]
1 change: 1 addition & 0 deletions lib/nelsnmp/vendors/mappings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

vendor_map = {}
vendor_map['9'] = 'cisco'
vendor_map['11'] = 'hpe'
vendor_map['2011'] = 'huawei'
vendor_map['2352'] = 'ericsson'
vendor_map['2636'] = 'juniper'
Expand Down
15 changes: 15 additions & 0 deletions tests/valid_hostinfo_files/hpe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
arubaos01:
sysobjectid: 1.3.6.1.4.1.11.2.3.7.8.5.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))"
vendor: hpe
os: arubaos-switch
version: KB.16.04.0009


arubaos02:
sysobjectid: 1.3.6.1.4.1.11.2.3.7.11.161
description: "HP J9851A Switch 5412Rzl2, revision KB.16.04.0009, ROM KB.16.01.0006 (/ws/swbuildm/rel_ukiah_qaoff/code/build/bom(swbuildm_rel_ukiah_qaoff_rel_ukiah))"
vendor: hpe
os: arubaos-switch
version: KB.16.04.0009