datacenter / who-moved-my-cli Goto Github PK
View Code? Open in Web Editor NEWA collection of simple Python scripts to help convert network engineers into programmer network engineers
A collection of simple Python scripts to help convert network engineers into programmer network engineers
Hello,
you mentioned in the source-code of supercommand.py that for running the script on Nexus5000 platform, xmltodict is needed as a dependency.
I tried this. But how can I get it working? I tried to copy xmltodict.py also to bootflash: but the import fails anyway. So how is it possible to make this import work on Nexus5000?
Regards,
Simon
JSON is having issues parsing the output of 'show cdp neighbor'. Had to replace cli.clid()
with cli()
since it doesn't seem to be supported within NXOS within VIRL.
nx-osv-1# >>> cdp = json.loads(cli('show cdp neighbor'))[
nx-osv-1# ... 'TABLE_cdp_neighbor_brief_info']['ROW_cdp_neighbor_brief_info']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/isan/python/scripts/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/isan/python/scripts/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/isan/python/scripts/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Running this script with NXOS version 6.0(2)N1(1) returned type error:
5548-2(config)# python bootflash:/scripts/interface_rate.py
Collecting and processing interface statistics ...
Traceback (most recent call last):
File "/bootflash/scripts/interface_rate.py", line 56, in
tree = ET.ElementTree(ET.fromstring(raw))
File "", line 106, in XML
raw = cli('show interface | xml | exclude "]]>]]>"', False)[1]
type(raw)
<type 'tuple'>
Removing the wrapper "raw" has the correct type resolved the issue;
NXOS info:
Software
BIOS: version 3.5.0
loader: version N/A
kickstart: version 6.0(2)N1(1)
system: version 6.0(2)N1(1)
Power Sequencer Firmware:
Module 1: version v1.0
Module 3: version v2.0
Microcontroller Firmware: version v1.2.0.1
SFP uC: Module 1: v1.0.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.