Community discussions

MikroTik App
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

cisco port channels

Wed Sep 10, 2008 11:13 pm

Some of my interfaces are port channels. I was trying to come up with an OID that showed any detail of the port channel like the interface names on the port channels or how many ports in the group.

Ultimately I would like to have the link show an error if a port channel is less than 2 interfaces...

I can imagine it shouldn't be too hard to add the port channel oid for a given link to the links tooltip but I am strugling with how to build it into a probe or a function that a probe runs.

I still can't find any oid that shows the ports attached to a port channel I have tried CISCO-PAGP-MIB and CISCO-PORT-CHANNEL-MIB and couldn't find any that looked promissing.

Anyone have any ideas?

Thanks
Sweet! Dude!
 
User avatar
Minollie
Frequent Visitor
Frequent Visitor
Posts: 96
Joined: Tue Nov 14, 2006 4:45 pm
Location: Netherlands

Re: cisco port channels

Thu Oct 09, 2008 7:15 pm

Hi Dude...

Don't know if this helps but maybe it's worth giving it a try:

I found this (after digging thru almost 100000 OID's)

Interfacedescription: [oid("1.3.6.1.2.1.2.2.1.2.x")]
Interfacespeed: [oid("1.3.6.1.2.1.2.2.1.5.x")] bps
One of our 4 Gbps channels pops-up with 4000000000 bps here

Adjusted to 'normal' looks
Interfacespeed: [oid("1.3.6.1.2.1.2.2.1.5.x")/1000000000] Gbps
The mentioned 4 Gbps channels displays this correctly with just simply 4 Gbps.

Maybe it's an option to create a function/probe using the x or the name/description, do some math and tell it in any way to warn when it drops to or below 2 Gbps? I don't know whether the value of Interfacespeed gets updated regularly enough (if it gets updated at all), maybe that changes then get displayed or result in changing state-colours.

I'm afraid you've to create a function/probe for every single channel you want to monitor, unless you've used a naming-convention with some logic.. ;), then you might have to create only some and use these when applicable.
I haven't found anything that looks like an OID observing which ports are members of the channel.

Added port-channels get a numeric OID-instance at the end of the table, after a reload of the device this will change in something more logic subsequent list. In that case you'll have to adjust some previous found values.
Sometimes it's possible to use the name in these cases, if not, then you'll have to adjust everything to the new value, which is then more or less to be the one exspected after each reload.

Good luck, if you find a better solution I would love to hear it! :D

Gr,
Minollie
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Wed Oct 15, 2008 1:22 am

Damn, Thanks for searching out all those OIDs.

I am stuck in an ugly VPN project and will re-visit this some time in the near future.
It would be nice to have time to work on this now since I have 2 channels down due to bad fiber.

I'd love to know that they started working again when they get fixed...

I will post the results of what I end up building and thank you very much for the details!

SD!
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Thu Oct 16, 2008 2:55 am

VPN Project on hold YEAH :)

I know this is the solution you provided as "worse case scenario" but I only have 2 multi-link routers. For the many gigabit Ether channels I hope to find a better solution... Like you were trying to find the oid that shows how many links are in an Ether channel and so was I but I still haven't found it :( I figure I am missing some mib at this point since the command "show etherchannel summary" shows you the ports in a channel it should be exposed by a mib somewhere.

Anyhow here is how to make a multi-link probe. And like you said the OID can change from a reboot so you might have to fix them... Search the oid and create a probe and assign that probe to just that device.
crtprobe.JPG
Works like a champ. I really don't want build a bunch of individually named probes!!!
muspeed.JPG
Here you can see that I shut down half of a multi-link. I renamed the probe with the device name in it but I took the screen shot before I fixed the probe...

Now to get it working automatically BLEH :)
You do not have the required permissions to view the files attached to this post.
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Thu Oct 16, 2008 4:05 am

do an snmp walk on this oid...

1.3.6.1.4.1.9.9.98.1.1.1.1.1

Let me know what you think.
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Thu Oct 16, 2008 10:24 pm

I added cisco-port-channel.mib and I don't get any results on the walk of the oid, forget the above oid...
1.3.6.1.4.1.9.9.285
http://www.oidview.com/mibs/9/CISCO-POR ... L-MIB.html

Cisco's web page claims you need all these other mibs. I don't understand.
http://tools.cisco.com/Support/SNMP/do/ ... HANNEL-MIB
Anyhow I added every mib that was not in the list and still nothin...
 
User avatar
Minollie
Frequent Visitor
Frequent Visitor
Posts: 96
Joined: Tue Nov 14, 2006 4:45 pm
Location: Netherlands

Re: cisco port channels

Mon Oct 20, 2008 1:09 pm

Hi Dude,

It remains incredibly silent here when I do a SNMP-walk on your given OID...
So, we're not particularly happy with Cisco Port-Channels and SNMP, are we? ;)

Nevertheless... I might have found something else.
Using the good-old IF-MIB (especially XEntry) I found another place where SNMP tries to make an educated guess about an interface's current bandwidth. The OID is: .1.3.6.1.2.1.31.1.1.1.15.x when I perform a SNMP-walk on this tree it provides me with values varying from 0 to 10000. All in nice neat round figures, steps of 100 if needed.

It does show a port-channel of us here off 10 Gbps as 10000 and others with their specified and current speed (one temporary link states 3000 and is actually a 3 Gbps link).
Since we are running an environment here where testing this OID is not appreciated on our test or production site switches I can't really tell if the above mentioned OID is realtime, in other words: I don't know whether it's value drops/rises when you plug in/out a connector.

I'll think something over how we can put this information into something usefull, but I can't guarantee a miracle though.. ;)..

Regards,
Minollie
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Mon Oct 20, 2008 5:38 pm

Hi Minollie,

Well I just happen to have a pair of port channels down...
I took a look at them and they are:
1.3.6.1.2.1.31.1.1.1.1.220 po2 = 1.3.6.1.2.1.31.1.1.1.15.220 = 1000 this has 1 port down.
1.3.6.1.2.1.31.1.1.1.1.221 po3 = 1.3.6.1.2.1.31.1.1.1.15.221 = 1000 this has 1 port down.
1.3.6.1.2.1.31.1.1.1.1.222 po4 = 1.3.6.1.2.1.31.1.1.1.15.222 = 2000 this has 2 ports UP.

I also double checked a 20 Gb port channel and it's value is 20000 just like you thought the value is certainly a nice round number describing the speed.

So yes it is possible to make a probe that complains about a specific port channel. I am afraid to automate these since it might be too SNMP intensive on switches with 400 ports on them it would perform an array_find "po?" to find the oids that are port channels. Then testing the corresponding value... Plus it would monitor port channels you might not be interested in.

I probably have 30 port channels it would not be that big of a deal to make 30 more probes and install them... Not the best solution but it would work. I am satisified that we did find a solution but damn it if it is not automatic!!! The tests above were on a 4500 switch and the 20gb port channel was a 3750, if your curious...

Thanks for all the help!!
SD
 
User avatar
Minollie
Frequent Visitor
Frequent Visitor
Posts: 96
Joined: Tue Nov 14, 2006 4:45 pm
Location: Netherlands

Re: cisco port channels

Mon Oct 20, 2008 6:07 pm

Hi SweetDude..

No thanks for the help.. I just 'love' to dig thru thousands of values.. ;). You're welcome!

Since I'm a disaster in coding with help of functions etc like array_size etc.
Could you assist in coding something that (w)(c)ould do the trick?
(We recently lost a whole bunch of channels due to a defective module on one of our Cisco 6506-E and I'm trying to get something in The Dude alerting us about something like that, but I'm a walking disaster in coding.. :()

Any help is greatly appreciated :D !

Regards,
Minollie
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Tue Oct 21, 2008 12:02 am

I agree programming functions is a pain... I am not that good at it yet either and have found very little reference on to how to code functions. I am sure you have about the same rough idea I have although maybe someone who know this stuff better will chime in!!!

Mostly I am woried that if you do use an automated function it would have to read the entire oid to find anything that contains "po" in the first oid and then find the corresponding speed in the other oid... It would querey all those oids as often as you had the probe run.

For example an smnp read of the 1.3.6.1.2.1.31.1.1.1.1 oid took two seconds on a stack with 36 ports. A swittch with 400 ports that might be 10 seconds or longer. You would only want to run it every few minutes max, it will add to CPU and network on your device.

The other method of creating a probe specifically for each OID takes very little time to reach a single oid but then you have complete setup and teardown of each read for each probe. Although you can probably run all those probes every 30 seconds and you will also know exactly which port channel is down based on the name of the probe. If you don't mind me asking how many channels did you have go down or how many do you want to track?

From what I can tell it is not possible to do loops or supply variables in functions which would make automating them much easier. Instead you would have to hard code the array_element to look at element 1 or 2 or 3... Meaning if you have 10 port channels you would read the first oid 10 times once for each port channel you wanted to test. You would need 10 probes also. Those 10 probes could be on every device. They would be very SNMP heavy. Ugg Anyhow HOPEFULLY someone who is better at functions will chime in...
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Tue Oct 21, 2008 7:12 pm

Ok I think I have it although it will probably be a little snmp intense... Although I now think the snmp reads might be cached.

With array_find we find that Po1 is in some element in the array, With array_element we use the element returned from the find to extract the value from another array of OIDS since both arrays have the same number of elements.. IT WORKS :)
po1.JPG
Create a function called find_Po1 and put the code below.
array_element(oid_column("1.3.6.1.2.1.31.1.1.1.15"), array_find(oid_column("1.3.6.1.2.1.31.1.1.1.1"), "Po1"))

As a test place [find_Po1()] on a device label and you will see the array_element from the function.
You would need to create a function for each port channel you want to find.

So now to make a probe... I will look at this more later.
You do not have the required permissions to view the files attached to this post.
 
SayaniB
just joined
Posts: 12
Joined: Wed Aug 13, 2014 12:18 pm

Re: cisco port channels

Fri Mar 06, 2015 11:29 am

Dear Lebowski,

I need to create a function to show operational status of the ports of a fortigate device in its label. I referred to a post made by you long back, as given below.

I created a function
Name: find_Po1
Code: array_element(oid_column("1.3.6.1.2.1.2.2.1.8"), array_find(oid_column("1.3.6.1.2.1.31.1.1.1.1"), "Po1"))

But the function returned value bad index..
I think I am using wrong code.

Please help me in understanding my fault ..
 
lebowski
Forum Guru
Forum Guru
Topic Author
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: cisco port channels

Fri Mar 06, 2015 7:21 pm

Just right click the subject device and SNMPwalk it, search the MIB for the interface, you are looking at standard mib2 stuff the interface details start at 1.3.6.1.2.1.2.2.1.1 which is the interface index and if there are 10 interfaces there will be 10 interface index oids (and any manually added vlans and other interfaces). Just find the interface admin status of the interface you are interested in and put that in the appearance. For example in Cisco the first interface is 1.3.6.1.2.1.2.2.1.7.10101 and the 10th interface is 1.3.6.1.2.1.2.2.1.7.10110. Put [oid("1.3.6.1.2.1.2.2.1.7.10110")] will display the admin status of the 10th interface in the appearance.
OR maybe this; Port10 status: [oid("1.3.6.1.2.1.2.2.1.7.10110")]

There is a post by Gsandul which shows how to build a probe that will send an email when an interface goes down...

Lebowski

Who is online

Users browsing this forum: No registered users and 14 guests