Start a Conversation

Unsolved

This post is more than 5 years old

462

September 28th, 2007 08:00

How to report on switch ports

I am tasked with createing a report in ports and cards that are in all of our switches. I have noticed that not all of my switches report the topology the same. We have many CISCO switches, and even among these, the ports are reported differently. Is there an easier way than to write case by case ASL code to retireve this information?

Thanks in adnvance

89 Posts

October 2nd, 2007 00:00

hi,

An easy way? weel, I guess you have to take in mind all cases in your network and then write your asl script.
There might be even cases where SMARTS won't report any ports on switches because there are either not certified, nor SNMP capable, etc ...

here is an example to print all interfaces from routers but you can change router by switch and interface by port

----------------------------------------------------------------------
START {
}
do {
routerList = getInstances("Router");
foreach arouter (routerList)
{
objRef = object(arouter);
componentList = objRef->ComposedOf;
print("****".arouter."****");
foreach component (componentList)
{
if ((component->CreationClassName == "Interface") &&
(glob('*Ethernet*', component->Description))) {
print(component);
}
}
}
stop();
}

------------------------------------------------------------------------------------

cheers
Fernando

2 Posts

October 2nd, 2007 12:00

Thanks for the answer. I do have a script that only works for a select group of switches, and the others (when looking at them in the topology) do show ports, but in another are. I may have to retrieve port information (by card by switch) by testing for switch type first .... does this sound reasonable?

89 Posts

October 2nd, 2007 22:00

well ...
I can't figure the different scenarios... the ports will be in the 'composed of' relation with a swith, at the same level as the cards, while the cards will have a 'Realizes' relationship with the ports ...
So, as far as i know if there is a card this will realize 'ports' but the swith will be 'composed of' ports ... Another issue are the interfaces, if you have defined Vlan interfaces, these won't be discovered as ports but interfaces and won't be realised by the card.
We have many different type of cisco switches, 3Com and Baynetworks and they all behave the same. Are there all your siwtches discovered as such? or do you have some discovered as Nodes? in this case is a certification issue. Otherwise attach an example if possible

cheers

Fernando
No Events found!

Top