Exemple #1
0
def gather_arp_table():

    DEV = check_connected()
    ARP_TABLE = ArpTable(DEV)
    ARP_TABLE.get()
    #print("\n")
    #print("Printing ARP TABLE")
    #print("-"*30)
    #pprint(ARP_TABLE.items())
    return ARP_TABLE.items()
Exemple #2
0
def gather_arp_table():
    arp_table = ArpTable(connection)
    arp_table.get()
    return dict(arp_table.items())
Exemple #3
0
ports.values()

ports['fe-0/0/1']
ports['fe-0/0/1'].items()
for k,v in ports['fe-0/0/1'].items():
	print k, v

ports['fe-0/0/1']['oper']
ports['fe-0/0/1']['macaddr']



from jnpr.junos.op.arp import ArpTable
arp_entries = ArpTable(a_device)
arp_entries.get()
arp_entries.items()
arp_entries.keys()
arp_entries.values()


from jnpr.junos.op.phyport import PhyPortTable
phy_ports = PhyPortTable(a_device)
phy_ports.get()
phy_ports.items()
phy_ports.keys()
phy_ports.values()
phy_ports['fe-0/0/1']
phy_ports['fe-0/0/1'].keys()
phy_ports['fe-0/0/1'].items()

a_device = Device(**juniper_srx)
a_device.open()

eth_ports = EthPortTable(a_device)
eth_ports.get()
print '-' * 80
print "Ethernet Ports"
for k, v in eth_ports.items():
    juniper_print(k, v)
print '-' * 80
raw_input("Hit enter to continue: ")

arp = ArpTable(a_device)
arp.get()
print '-' * 80
print "ARP"
for k, v in arp.items():
    juniper_print(k, v)
print '-' * 80
raw_input("Hit enter to continue: ")

lldp = LLDPNeighborTable(a_device)
lldp.get()
print '-' * 80
print "LLDP Neighbors"
for k, v in lldp.items():
    juniper_print(k, v)
print '-' * 80
raw_input("Hit enter to continue: ")
print '-' * 80
Exemple #5
0
from jnpr.junos import Device
from jnpr.junos.op.arp import ArpTable
from getpass import getpass
from pprint import pprint

srx2 = Device(host="srx2.lasthop.io", user="******", password=getpass())
srx2.open()

arp_entries = ArpTable(srx2)
arp_entries.get()

print(arp_entries)
print(arp_entries.keys())
pprint(arp_entries.values())
pprint(arp_entries.items())