Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting number of switch ports

Status
Not open for further replies.

JJ1

Programmer
Apr 19, 2001
104
GB
Dear All,

I need to count the total number of switch ports which are in use on our network. I have a list of all the switches we have (over 300) but I really don't want to telnet into all of them individually and type in 'show ports' for each.

We use cisco 2924's and 2916's along with others. Also, we have cisco works 2000.

Any help would be much appreciated.
Thanks in advance,

James.

 
Managed it!

Firstly, we got a list of the VLAN numbers inside the relevant department (Banking, in our case). (This was done via a unix 'ypcat' command)

We then telneted into our cisco catalyst 5000 series for each of the VLANs and executed &quot;sh cam count dyn <vlan no.>&quot;

This displayed all the active ports at that time.

Hope this helps someone in future,

James.
 
What I used to generate this information was to use one of Cisco's SNMP MIBs to gather the information from the switches via a perl script. Another thing you could use is Expect, to automate the telnet access and gather execute the commands for you. I found the perl script to be a little easier to work with, well sort of. I'm no programmer, it wasn't very pretty, but I got what I needed. The MIBs can be downloaded from CCO if you have access to that. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top