Get info from switch with SNMP

292 Views Asked by At

I am currently working on a project and I'm looking to retrieve the information about all the hosts in a network (ip, mac, leaf's port, vlan, vrf, l2vni, l3vni). The network is a SDN with 70 leafs and 5000 hosts.

I have in my possession all the mac and ip addresses of the hosts, and the ip address of the leaf the host is connected to.

In order to do this, I'm building a SSH connection with each leaf and I launch these CLI commands for each host of the leaf:

  • sh mac address-table address {mac_address of the host} => to retrieve the leaf's port and the VLAN
  • sh bgp l2vpn evpn {ip_address of the host} => to retrieve l2vni and l3vni
  • sh vrf detail | i {l3vni} => to retrieve the VRF

The problem is that it takes me more than one hour to retrieve all the info beacause we have 5000 hosts.

Do you please know if there is a way to get these same info using SNMP please? I know that retrieving a specific information with SNMP require to get the right OID code but I don't know if these informations are getable with SNMP?

I plan to use pysnmp with python.

Can someone help me please?

Thank you

0

There are 0 best solutions below