---

Python HowTo: Find the port on a switch that a host belongs to

[ Thanks to asanabria6910 for this link.
]

“The other day I was speaking to a buddy of mine. I asked him
how cool would it be, if you could just get the port on a switch
that you are plugged into, in one line? So since I thought about
it… I figured why not…. I just finished writing the first
revision ( I’m assuming more to come). I must say that I am quite
pleased with it. Right now you can pass the switch you want to talk
too, the community string, and either the MAC or IP address of the
host device. In return you will get the MAC Address, IP Address,
Port Description (VLAN), and Port you are plugged into.”


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis