import sys import time from cisco import cli from cisco import clip # v2.1 # Authors: Shaun Gomez & John Senkow # Clear all multicast state for given group on NXOS # Python 2.7 mcast_g = str(sys.argv[1]) cli("clear ip igmp groups " + mcast_g) cli("clear ip pim route " + mcast_g) cli("clear ip mroute data-created " + mcast_g) cli("clear ip netstack mroute " + mcast_g) print 'All Multicast State Cleared For:' print mcast_g print 'Verification of State Clear, Please Wait 3 Seconds to Complete' for verify_print in xrange(3, 0, -1): time.sleep(1) print verify_print clip("show ip igmp groups " + mcast_g) clip("show ip igmp route " + mcast_g) clip("show ip mroute " + mcast_g) clip("show ip pim route " + mcast_g) print "Verification Complete"
import sys from cisco import cli from cisco import clip # v1.1 # Authors: Shaun Gomez & Predrag Zivkovic # Return optical light levels for a specfied interface (passed through CLI argument) # Python 2.7 eth_int = str(sys.argv[1]) print "Returning optical light levels for " + eth_int cli_cmd = clip("show interface " + eth_int + " trans detail | inc Tx|Rx") print cli_cmd
import sys import time from cisco import cli from cisco import clip # v2.1 # Shaun Gomez # John Senkow # # Clear all multicast state for given group on NXOS # # mcast_g = str(sys.argv[1]) cli("clear ip igmp groups " + mcast_g) cli("clear ip pim route " + mcast_g) cli("clear ip mroute data-created " + mcast_g) cli("clear ip netstack mroute " + mcast_g) print "All Multicast State Cleared For:" print mcast_g print "Verification of State Clear, Please Wait 3 Seconds to Complete" for a in xrange(3, 0, -1): time.sleep(1) print a clip("show ip igmp groups " + mcast_g) clip("show ip igmp route " + mcast_g) clip("show ip mroute " + mcast_g) clip("show ip pim route " + mcast_g) print "Verification Complete"
import sys from cisco import clip # Author: Shaun Gomez # Display both CDP & LLDP neighbors for @penultimateadam # Python 2.7 clip ('show cdp nei ; show lldp nei') print 'show neighbors (LLDP & CDP) completed'
import sys from cisco import cli from cisco import clip # # v1.0 # Shaun Gomez # Predrag Zivkovic # # Return optical light levels for a specfied interface (passed through CLI argument) # # eth_int = str(sys.argv[1]) print "Returning optical light levels for " + eth_int a = clip("show interface " + eth_int + " trans detail | inc Tx|Rx") print a