Unsolved
This post is more than 5 years old
2 Posts
0
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
Thanks in adnvance
No Events found!
Dinand1
89 Posts
0
October 2nd, 2007 00:00
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
tonyj1
2 Posts
0
October 2nd, 2007 12:00
Dinand1
89 Posts
0
October 2nd, 2007 22:00
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