networklore / ansible-snmp

SNMP modules for Ansible
Other
8 stars 6 forks source link

SNMP Queries of new Aruba Switches return "UNKNOWN" for all three fields. #3

Closed bkwood89 closed 6 years ago

bkwood89 commented 6 years ago

When I run my playbook, the task for GET LLDP NEIGHBORS fails and it seems to be because the SNMP task does not return the proper version. The switch is an Aruba 3810M running KB.16.04.0009 soon to be running KB.16.05.0007.

Troubleshooting: I have tested with Cisco and had (not in uploaded files) been calling a variable from the group_vars to call the correct version of "show lldp neighbors" (even though the present file shows a cdp command).

Thanks in advance! I don't know if you plan on keeping this up-to-date, but it has been an asset to us thus far.

Any thoughts as to why the version info returned would be UNKNOWN?

Main output:

ok: [itb-neteng-b-nomon] => { "ansible_facts": { "ansible_device_os": "UNKNOWN", "ansible_device_vendor": "UNKNOWN", "ansible_device_version": "UNKNOWN" }, "changed": false, "invocation": { "module_args": { "authkey": null, "community": "expand", "host": "itb-neteng-b-nomon", "integrity": null, "level": null, "port": 161, "privacy": null, "privkey": null, "username": null, "version": "2c" } } }

TASK [GET SNMP DISCOVERY INFORMATION] ** task path: /home/adm.bwood7/ansible/auto-config-port-descriptions.yml:14 Using module file /home/adm.bwood7/.ansible/plugins/modules/ansible-snmp/library/snmp_device_version.py-ORIG

ESTABLISH LOCAL CONNECTION FOR USER: adm.bwood7 EXEC /bin/sh -c 'echo ~adm.bwood7 && sleep 0' EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957 `" && echo ansible-tmp-1529962064.11-245345196987957="` echo /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957 `" ) && sleep 0' PUT /home/adm.bwood7/.ansible/tmp/ansible-local-11605g0vFl4/tmpjr92pd TO /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957/snmp_device_version.py-ORIG EXEC /bin/sh -c 'chmod u+x /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957/ /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957/snmp_device_version.py-ORIG && sleep 0' EXEC /bin/sh -c '/usr/bin/python /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957/snmp_device_version.py-ORIG && sleep 0' EXEC /bin/sh -c 'rm -f -r /home/adm.bwood7/.ansible/tmp/ansible-tmp-1529962064.11-245345196987957/ > /dev/null 2>&1 && sleep 0' ok: [itb-neteng-b-nomon] => { "ansible_facts": { **"ansible_device_os": "UNKNOWN", "ansible_device_vendor": "UNKNOWN", "ansible_device_version": "UNKNOWN"** }, "changed": false, "invocation": { "module_args": { "authkey": null, "community": "expand", "host": "itb-neteng-b-nomon", "integrity": null, "level": null, "port": 161, "privacy": null, "privkey": null, "username": null, "version": "2c" } } } TASK [GET LLDP NEIGHBORS] ********************************************************************************************************************************************************************************** task path: /home/adm.bwood7/ansible/auto-config-port-descriptions.yml:20 fatal: [itb-neteng-b-nomon]: FAILED! => { "msg": "The task includes an option with an undefined variable. The error was: 'creds' is undefined\n\nThe error appears to have been in '/home/adm.bwood7/ansible/auto-config-port-descriptions.yml': line 20, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: GET LLDP NEIGHBORS\n ^ here\n" } PLAY RECAP ************************************************************************************************************************************************************************************************* itb-neteng-b-nomon : ok=1 changed=0 unreachable=0 failed=1 Files are included in the .zip file (ansible.cfg, playbook (auto-config-port-descriptions.yml), group_vars, and hosts): ******************************************************************************************* PREVIOUS OUTPUT FOR 'GET LLDP NEIGHBORS' ******************************************************************************************* The full traceback is: Traceback (most recent call last): File "/tmp/ansible_LLbyrs/ansible_module_ntc_show_command.py", line 511, in main() File "/tmp/ansible_LLbyrs/ansible_module_ntc_show_command.py", line 454, in main device = ConnectHandler(**device_args) File "/usr/lib/python2.7/site-packages/netmiko/ssh_dispatcher.py", line 176, in ConnectHandler 'currently supported platforms are: {}'.format(platforms_str)) ValueError: Unsupported device_type: currently supported platforms are: a10 accedian alcatel_aos alcatel_sros arista_eos **aruba_os** avaya_ers avaya_vsp brocade_fastiron brocade_netiron brocade_nos brocade_vdx brocade_vyos calix_b6 checkpoint_gaia ciena_saos cisco_asa cisco_ios cisco_nxos cisco_s300 cisco_tp cisco_wlc cisco_xe cisco_xr coriant dell_force10 dell_powerconnect eltex enterasys extreme extreme_wing f5_ltm fortinet generic_termserver hp_comware hp_procurve huawei huawei_vrpv8 juniper juniper_junos linux mellanox mrv_optiswitch netapp_cdot ovs_linux paloalto_panos pluribus quanta_mesh ruckus_fastiron ubiquiti_edge ubiquiti_edgeswitch vyatta_vyos vyos Attached files: [ArubaTroubleshooting.zip](https://github.com/networklore/ansible-snmp/files/2134885/ArubaTroubleshooting.zip)
ogenstad commented 6 years ago

The problem is that the nelsnmp library doesn't support Aruba.

Can you open an issue in that repo instead? https://github.com/networklore/nelsnmp/issues

What I'd need from you is the output from the below Python code, just swap out to match your device, mask the community if you want to. Aside from the below output it would be great if you could make a short note of what you think the values for vendor, os and version should be. With that info it should be easy enough to fix.

>>> import nelsnmp
>>> from nelsnmp.hostinfo.device import HostInfo
>>> from nelsnmp.snmp import SnmpHandler
>>>
>>> handler = SnmpHandler(host='og-sw-01', version='2c', community="public")
>>> hostinfo = HostInfo(handler)
>>> hostinfo.get_all()
>>> hostinfo.__dict__
{'sysobjectid': '1.3.6.1.4.1.9.1.798', 'vendor': 'cisco', 'description': u'Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2017 by Cisco Systems, Inc.\r\nCompiled Sat 19-Aug-17 09:34 by prod_rel_team', 'uptime': datetime.timedelta(109, 63313, 570000), 'contact': u'v3me', 'location': u'v3location', 'version': u'15.0(2)SE11', 'os': 'ios', '_snmp': <nelsnmp.snmp.SnmpHandler object at 0x108a433d0>}
>>>
bkwood89 commented 6 years ago

Thank you for the quick reply, here is the output that you requested:

import nelsnmp from nelsnmp.hostinfo.device import HostInfo from nelsnmp.snmp import SnmpHandler

handler = SnmpHandler(host='itb-neteng-b-nomon', version='2c', community="public") hostinfo = HostInfo(handler) hostinfo.get_all() hostinfo.dict {'sysobjectid': '1.3.6.1.4.1.11.2.3.7.8.5.4', 'vendor': 'UNKNOWN', 'description': u'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))', 'uptime': datetime.timedelta(56, 12254), 'contact': u'', 'location': u'', 'version': 'UNKNOWN', 'os': 'UNKNOWN', '_snmp': <nelsnmp.snmp.SnmpHandler object at 0x7fbe7950e310>}

From that output above here are what I believe the values should be (I've not seen this anywhere, but I know that hpe bought out Aruba): vendor: hpe

os: arubaos-switch (This is an odd one, anywhere I look this is the name that I get from other people, but I've never seen this documented officially or in the OS itself.)--This difference could be due to arubaos being used for their access points and controllers.

version: (ie. in this case it would be KB.16.04.0009). One thing that may help is the following:

Aruba titles the OS versions differently based on the hardware: For the 5400 and 3810 devices they use KB_xx_xx_xxxx.swi: KB_16_05_0007.swi For the 2930 devices they use WC_xx_xx_xxxx.swi: WC_16_05_0007.swi For the 2500 devices they use YA_xx_xx_xxxx.swi: YA_16_05_0007.swi

Thank you again! Let me know if there is anything else you would like me to do or get. I'll go create an issue over on the repo you posted above.

Best regards,

ogenstad commented 6 years ago

Working on this in the Nelsnmp repo.