[mrtg] Re: Obtaining OID's

Nicolai Strøm Gylling nsg at webpartner.dk
Mon Jul 15 16:01:43 MEST 2002

This is exactly the kind of information I wanted, and great with an example too.

Thanks a lot.

-----Original Message-----
From: darek [mailto:darek at nyi.net] 
Sent: 15. juli 2002 14:30
To: Nicolai Strøm Gylling
Cc: mrtg at list.ee.ethz.ch
Subject: Re: [mrtg] Obtaining OID's

Nicolai Strøm Gylling wrote:

>Is there a howto on obtaining OID's for different equipment, or how to 
>"create" your own, ex. for monitoring a mailqueue on a Unix-server?
You can write your own scripts to be executed by mrtg. The script has to 
return 4 lines. The first 2 being the values you want to monitor, the 
3rd line being the name of the device, the last line being the uptime.

In my config for a particular UPS I have:

Target[C.BattRem]: `/usr/local/bin/mrtg-battremaining.pl upsC`

Returns capacity of the UPS battery in minutes

>So I (and probably a lot others) would appreciate a little how-to on, 
>ex.  How . translates into the temperature of 
>a Extreme Networks Summit48.
There is a usenet post that is quite informative. It is available on 
deja.com, try searching for it, as I lost the address myself.. So maybe 
I will try to explain the process of getting an OID from an MIB file.

Suppose you want to get the OID for upsAdvControlFlashAndBeep, which 
makes the UPS beep and light up so that you can find it. Open up the 
powernet.mib file, and find the entry for this:

upsAdvControlFlashAndBeep OBJECT-TYPE
   ::= { upsAdvControl 5 }

You note the 5.

The next step is to search backwards (up in the file) for upsAdvControl 
(the name next to the 5).  You will see something like this:

upsAdvControl                  OBJECT IDENTIFIER ::=  { upsControl 2 }

You will prepend the 2 to the previous 5 like so: 2.5

You then search for upsControl:
upsControl                     OBJECT IDENTIFIER ::=  { ups 6 }

Now you should have 6.2.5

You then repeat the search:
ups                            OBJECT IDENTIFIER ::=  { hardware 1 }
hardware                       OBJECT IDENTIFIER ::=  { products 1 }
products                       OBJECT IDENTIFIER ::=  { apc 1 }
apc                            OBJECT IDENTIFIER ::=  { enterprises 318 }

prepending each number to your string. At the end of the process you 
would end up with:
enterprises.318. , with an appended .0 (you need the .0 at 
the end)

You can also look up the numeric representation of enterprises and 
replace it, but enterprises seems to work fine.

So now you can issue:
    /usr/local/bin/snmpset <IP> private enterprises.318. i 1 and make the UPS beep and light up like a Christmas tree.

If my explanation isn't clear, you might try searching for that usenet post.

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list