Created
October 21, 2014 14:24
-
-
Save fredhsu/80e19f6fadeba3a3ebf7 to your computer and use it in GitHub Desktop.
eAPI script to see all the arp entries per VRF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jsonrpclib import Server | |
switch = Server( "https://admin:admin@leaf1/command-api" ) | |
response = switch.runCmds( 1, ["show vrf"], "text" ) | |
lines = response[0]['output'].splitlines() | |
for line in lines: | |
print line | |
for i in range(2, len(lines) - 1): | |
vrfname = lines[i].split()[0] | |
command = "show ip arp vrf " + vrfname | |
response = switch.runCmds( 1, [command] ) | |
print vrfname | |
print response[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment