networklore / nelsnmp

A wrapper module for pysnmp
Other
7 stars 10 forks source link

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

Open bkwood89 opened 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": "public", "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

ogenstad commented 6 years ago

I opened PR #19 to add support for this device, do you think you can check with that one and see if it works?

bkwood89 commented 6 years ago

I was gone for the last week. I have not worked with upgrading the pip package to the specific commit, but I think we've got it updated. We are testing with it now, I should have an update for you shortly. In the initial testing, it is looking good--The Unknown fields are filling in properly with the desired output. Thank you again!

bkwood89 commented 6 years ago

We are working out templates for the Aruba device now. From our testing, half of our devices are working as they should. We have another 50% that are still registering as UNKNOWN. Here is the print out that you requested before for the others devices (the fix you implemented for the previous devices has worked like a dream).

Thank you again for all of your help with this!

Output for the currently, non-working devices: Version is the "revision KB.16.04.0009" os should be arubaos-switch

{'sysobjectid': '1.3.6.1.4.1.11.2.3.7.11.161', 'vendor': 'hpe', 'description': u'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))', 'uptime': datetime.timedelta(237, 28713, 100000), 'contact': u'', 'location': u'', 'version': 'UNKNOWN', 'os': 'UNKNOWN', '_snmp': <nelsnmp.snmp.SnmpHandler object at 0x7f0733fdc250>}

import nelsnmp

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

handler = SnmpHandler(host='itb-3206-a', version='2c', community="public") hostinfo = HostInfo(handler) hostinfo.get_all() hostinfo.dict {'sysobjectid': '1.3.6.1.4.1.11.2.3.7.11.161', 'vendor': 'hpe', 'description': u'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))', 'uptime': datetime.timedelta(237, 28713, 100000), 'contact': u'', 'location': u'', 'version': 'UNKNOWN', 'os': 'UNKNOWN', '_snmp': <nelsnmp.snmp.SnmpHandler object at 0x7f0733fdc250>}

ogenstad commented 6 years ago

I've updated the PR based on the information you provided, could you test again?

Ondjultomte commented 4 years ago

Any news here? I got some old HP switches that I get UNKNOWN on all three fields.

ie. HP 2510-48 Switch (J9020A) Software revision : U.11.57 Rom Version: R.10.06