Closed jajaalma closed 6 years ago
Hi, I am having issues with napalm-eos module accesing arista router with configured enable secret. I seems that napalm-eos commands cannot pass through the priviledge mode. If I disable enable secret however, I would get my desired outputs.
=== Arista Router Details=== Hardware version: 11.01 Software image version: 4.19.4.1M Architecture: i386 Internal build version: 4.19.4.1M-7459145.41941M Internal build ID: 3b7d57ba-9c09-4bb1-80a6-6d8c6cf1d07d
============
===Sample Script====== import json from napalm import get_network_driver driver = get_network_driver('eos') iosvl2 = driver('veos', 'eapi', 'password') iosvl2.open()
bgp_neighbors = iosvl2.get_bgp_neighbors() print (json.dumps(bgp_neighbors, indent=4))
iosvl2.close()
====Output=====
(py-napalm) [root@rancid bin]# python proj_eos Traceback (most recent call last): File "proj_eos", line 6, in iosvl2.open() File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/napalm/eos/eos.py", line 122, in open self.device.run_commands(['show clock'], encoding='text') File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/pyeapi/client.py", line 730, in run_commands response = self._connection.execute(commands, encoding, **kwargs) File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/pyeapi/eapilib.py", line 499, in execute response = self.send(request) File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/pyeapi/eapilib.py", line 418, in send raise CommandError(code, msg, command_error=err, output=out) pyeapi.eapilib.CommandError: Error [1005]: CLI command 1 of 2 'enable' failed: permission to run command denied
=======
====pip list output===
(py-napalm) [root@rancid bin]# pip list DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. asn1crypto (0.24.0) bcrypt (3.1.4) certifi (2018.1.18) cffi (1.11.4) chardet (3.0.4) cryptography (2.1.4) future (0.16.0) idna (2.6) Jinja2 (2.10) jtextfsm (0.3.1) junos-eznc (2.1.7) lxml (4.1.1) MarkupSafe (1.0) napalm (2.3.0) ncclient (0.5.3) netaddr (0.7.19) netmiko (2.0.2) paramiko (2.4.0) pip (9.0.1) pyasn1 (0.4.2) pycparser (2.18) pyeapi (0.8.2) pyIOSXR (0.52) PyNaCl (1.2.1) pynxos (0.0.3) pyserial (3.4) PyYAML (3.12) requests (2.18.4) scp (0.10.2) setuptools (28.8.0) six (1.11.0) textfsm (0.3.2) urllib3 (1.22)
already found the solution to this
Are you kind enough to share the solution, please?
Hi, I am having issues with napalm-eos module accesing arista router with configured enable secret. I seems that napalm-eos commands cannot pass through the priviledge mode. If I disable enable secret however, I would get my desired outputs.
=== Arista Router Details=== Hardware version: 11.01 Software image version: 4.19.4.1M Architecture: i386 Internal build version: 4.19.4.1M-7459145.41941M Internal build ID: 3b7d57ba-9c09-4bb1-80a6-6d8c6cf1d07d
============
===Sample Script====== import json from napalm import get_network_driver driver = get_network_driver('eos') iosvl2 = driver('veos', 'eapi', 'password') iosvl2.open()
arptable = iosvl2.get_arp_table()
print (json.dumps(arptable, indent=4))
facts= iosvl2.get_facts()
print (json.dumps(facts, indent=4))
bgp_neighbors = iosvl2.get_bgp_neighbors() print (json.dumps(bgp_neighbors, indent=4))
iosvl2.close()
====Output=====
(py-napalm) [root@rancid bin]# python proj_eos Traceback (most recent call last): File "proj_eos", line 6, in
iosvl2.open()
File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/napalm/eos/eos.py", line 122, in open
self.device.run_commands(['show clock'], encoding='text')
File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/pyeapi/client.py", line 730, in run_commands
response = self._connection.execute(commands, encoding, **kwargs)
File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/pyeapi/eapilib.py", line 499, in execute
response = self.send(request)
File "/home/dcnguyen/napalm/py-napalm/lib/python3.6/site-packages/pyeapi/eapilib.py", line 418, in send
raise CommandError(code, msg, command_error=err, output=out)
pyeapi.eapilib.CommandError: Error [1005]: CLI command 1 of 2 'enable' failed: permission to run command denied
=======
====pip list output===
(py-napalm) [root@rancid bin]# pip list DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. asn1crypto (0.24.0) bcrypt (3.1.4) certifi (2018.1.18) cffi (1.11.4) chardet (3.0.4) cryptography (2.1.4) future (0.16.0) idna (2.6) Jinja2 (2.10) jtextfsm (0.3.1) junos-eznc (2.1.7) lxml (4.1.1) MarkupSafe (1.0) napalm (2.3.0) ncclient (0.5.3) netaddr (0.7.19) netmiko (2.0.2) paramiko (2.4.0) pip (9.0.1) pyasn1 (0.4.2) pycparser (2.18) pyeapi (0.8.2) pyIOSXR (0.52) PyNaCl (1.2.1) pynxos (0.0.3) pyserial (3.4) PyYAML (3.12) requests (2.18.4) scp (0.10.2) setuptools (28.8.0) six (1.11.0) textfsm (0.3.2) urllib3 (1.22)
=======