Cisco iOS SNMP OID for Vlan on Port

ciscosnmptrunk

I am working on setting up SNMP monitoring for our internal switched network in Zabbix.

I have everything working now, but the template I am using discovers all ports on the switch, and I really only need to monitor the trunk port.

So far I am using various regex to decide which port on a switch is the trunk port, but I am running into a lot of cases where the trunk port we are using isn't consistent.

For example many of our switches might have GI[0-9]/1/[1-4] as the trunk(s) but others may have GI[0-9]/0/(24|48) or on older ones GI0/(49|50|51|52).

So I have decided to avoid a lot of extra work down the road to try and decide which ports are the trunk port using an OID, but so far I am having trouble seeing an OID that would work.

If I type:

sh int status

And navigate down the list, I have noticed that the vlan column simply says "trunk" for the ports that we have set up as trunk ports.

Is there a way to pull whether or not a port is in trunk mode using cisco MIBs / OIDs?

I should preface all of this by saying I am still struggling to learn all of the details of going through a MIB tree to see all of th eOIDs and what they do, and am generally new to SNMP monitoring.

EDIT:

https://supportforums.cisco.com/t5/network-management/snmp-oids-to-identify-port-mode-setting-on-3750-6509-and-nexus/td-p/2400948

According to the link above there should be an OID, but when I snmpwalk with my community string, and push the output to a text file, I do not see the OID they mention.

I have grep the file for trunk and Trunk as strings with no luck as well.

EDIT2:

I ended up finding out that our platform(s) do not support the CISCO-VTP-MIB.

Best Answer

I'm not answering precisely to your question but I had almost the same issue but with nagios.

I created a script reading the interface description to determine what kind of port I was monitoring. each interface description was starting with a code (for example CUS followed by the real interface description)

This was a really good option, it was only necessary to well describe each interface and I was able to make different class (Internal critical interfaces, non critical interfaces, customers interfaces, customers with SLA and so one) and this was linked with various behavious on nagios (alarms, notifications aso.)

HTH