More info about the Cisco Nexus can be found here:
http://www.cisco.com/en/US/products/ps9494/Products_Sub_Category_Home.html
Example:
switch# show clock 23:54:55.872 UTC Wed May 16 2012 switch# python !-- Enter Python interpreter switch# >>> cli("conf term ; interface loopback 1") switch(config-if)# >>> cli("ip address 1.1.1.1/24") switch(config-if)# >>> cli("exit") !-- Exit the CLI interface mode switch(config)# >>> cli("exit") switch# >>> i=0 switch# >>> while i<8: switch# ... i=i+1 !-- Composite command; prompt indicates more input switch# ... cmd = "show module %i" % i switch# ... r=clid(cmd) switch# ... if "TABLE_modinfo/model" in r.keys(): switch# ... if r["TABLE_modinfo/model"] == "Nurburgring": switch# ... print "got a racer in slot %d" % i switch# ... !-- Empty input indicates end of loop got a racer in slot 3 switch# >>> exit ! -- Exit Python interpreter switch#
No comments:
Post a Comment