[Solved] How do I combine OIDs from different MIBs?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

[Solved] How do I combine OIDs from different MIBs?

Post by jbruyet »

Hey all, this may look a little familiar because it is. I found an answer to a tangential issue that came up in my previous thread but it didn't fix my initial issue. Here's the updated version...

I finally found a MIB that has OIDs for TxBytesPerSec and RxBytesPerSec for my DL360 servers but I don't know enough about snmp yet to figure out how to include the interface. Here's what I want from the MIB:

Code: Select all

    cpqLinOsNetworkInterfaceTxBytesPerSec OBJECT-TYPE
            SYNTAX  INTEGER
            ACCESS  read-only
            STATUS  mandatory
            DESCRIPTION
           "Number of bytes per second that were transmitted from the network
                 interface."
            ::= { cpqLinOsNetworkInterfaceEntry 5 }
I'm guessing from the first line that I need the "label" for the interface. Here's what I'm using pulled from snmpwalk:

Code: Select all

    IF-MIB::ifDescr.65539 = STRING: HP Network Team #1
I know that's correct because I can pull this:

Code: Select all

    root@FreeNag:/usr/home/jobee/SNMP # snmpget -v 2c -c public 192.168.2.29 ifDescr.65539
    IF-MIB::ifDescr.65539 = STRING: HP Network Team #1
How do I combine the interface designator with the BytesPerSecond OID?

Thanks,

Joe B
Last edited by jbruyet on Fri May 02, 2014 12:17 pm, edited 1 time in total.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How do I combine OIDs from different MIBs?

Post by abrist »

So if I understand correctly, you are trying to check interface usage by names found in a separate MIB? This will most likely have to be done with a wrapper script, either that or I have misunderstood your scenario.
Usually your device's MIB, or just the generic SNMP mibs have the oids necessary to check port name and bandwidth.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: How do I combine OIDs from different MIBs?

Post by jbruyet »

Hi abrist, what I'm looking for is an OID that will give me the current Bytes Per Second and I have yet to find a stock OID that would give me that information. I downloaded a plethora of MIBs from the HP web site and in those MIBs I found cpqlinos.mib that contains the following:

Code: Select all

 cpqLinOsNetworkInterfaceTxBytesPerSec OBJECT-TYPE
        SYNTAX  INTEGER
        ACCESS  read-only
        STATUS  mandatory
        DESCRIPTION
       "Number of bytes per second that were transmitted from the network
             interface."
        ::= { cpqLinOsNetworkInterfaceEntry 5 }
THAT is what I'm trying to read but I don't know how to associate that OID (is it even an OID?) with the interface I'm trying to monitor. I have found stock OIDs that give a cumulative value for Octets and Unicast Packets and such but nothing that gives a "current value."

I don't have a lot of experience with snmp so I don't know if I'm overlooking something basic, or if I'm even heading in the right direction.

Thanks,

Joe B
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How do I combine OIDs from different MIBs?

Post by abrist »

jbruyet wrote:I have found stock OIDs that give a cumulative value for Octets and Unicast Packets and such but nothing that gives a "current value."
These are the default metrics that can be collected through the standard SNMP v2 mibs. If the mib you found is for the device, and not another, you should be able to check it through snmp. You will find the mib name to oid mapping at the following link: http://www.oidview.com/mibs/232/CPQLINOS-MIB.html
You need to run an snmpwalk of your device and check for the oid's presence:

Code: Select all

snmpwalk -v 2c -c <community> <host ip> | grep 1.3.6.1.4.1.232.23.2.10.2.1.5
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: How do I combine OIDs from different MIBs?

Post by jbruyet »

Nope, that OID isn't in there. I tried several different OIDs from that MIB and none of them are in there. So the server already has OIDs that are pretty much hard coded into the system, right? Therefore I may be out of luck for this search. I guess I can trace runs back to the IDF room, figure out which run is going to which port on which switch and then monitor that port. I was hoping for something a little more direct but that's the way it goes sometimes. Again, thanks for the help.

Thanks,

Joe B
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How do I combine OIDs from different MIBs?

Post by abrist »

Can you run a full walk of the device and then attach the walk output to your next post? There may be some oids that cover the metrics you are looking for, but lets start by looking at which actual oids we have to work with:

Code: Select all

snmpwalk -v 2c -c <community> <host ip> > /tmp/walk.txt
Attach /tmp/walk.txt to your next post.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: How do I combine OIDs from different MIBs?

Post by jbruyet »

Hi abrist, here's the snmpwalk of the server I'm working on at this time. Thanks for the help.

Thanks,

Joe B
Attachments
walk.txt
(261.22 KiB) Downloaded 377 times
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How do I combine OIDs from different MIBs?

Post by abrist »

There are a ton of oids that look like windows oids. Did you run this walk against the switch, or a windows server? Which one are you trying to collect the txbytes from?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: How do I combine OIDs from different MIBs?

Post by jbruyet »

I ran this snmpwalk on a Windows server, and it's from this server that I'm trying to pull the information. My primary interest in this is that I've had users complain that their connections to some of my servers run very slowly sometimes and I wanted to alert on that so I could see what those users are doing at that time.

Thanks,

Joe B
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How do I combine OIDs from different MIBs?

Post by abrist »

Unfortunately, windows boxes only support the octet counters, not a current throughput.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked