[mrtg] Re: mrtg and mib files

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Jan 22 13:38:25 MET 2000


Duane Cox wrote:
> 
> I have been using mrtg for a few months now.. and use the cfgmaker to poll
> equipment to gather info.
> But I have some hardware... 3com office connect stuff.. that cfgmaker
> doesn't seem to work really well for.
> I do have the 3com mib file for this hardware, and was wondering what can I
> get mrtg to do with this mib file
> and this hardware?  What steps to I need to do, or what documentation do I
> need to read?
> 

For general questions on SNMP, there are several resources on the web.
Try deja, altavista and similar sites.

I'll try and compose a crash course (far from complete!) here that shows
you how to monitor interesting stuff:


Your mib file contains the description for a part of the complete MIB.
The MIB is a tree-like structure.  I'll use the file cisco-envmon-mib
as an example:

At the start it contains an IMPORTS section.  It defines what other
files are needed and what part of those files.  One of those imports
is: "ciscoMgmt FROM CISCO-SMI;".  If you use some program to view the
mib and want to load this envmon mib in it, you probably need to load
this cisco-smi file first.

You don't need to import the mib file in MRTG, if you do import it you
can use the textual representation of the OID.  If you don't import it,
you will need to use the numeric representation as I did below.

Just after the imports section, this definition is made:
 "ciscoEnvMonMIB OBJECT IDENTIFIER ::= { ciscoMgmt 13 }"
It means that in this file "ciscoEnvMonMIB" is used and it could be
read as "ciscoMgmt.13".  Previous paragraph shows that you should view
another file to find out how "ciscoMgmt" is built; if you parse all
files needed you will end up with "1.3.6.1.4.1.9.9" and therefore we
now now the complete "ciscoEnvMonMIB" to be "1.3.6.1.4.1.9.9.13"

Browsing the file I see "ciscoEnvMonTemperatureStatusValue" and its
description: "The current measurement of the testpoint being instrumented."
This looks interesting so I want to know how to monitor it.
Complete entry is:
   ciscoEnvMonTemperatureStatusValue OBJECT-TYPE
       SYNTAX Gauge32
   --  Units
   --    degrees Celsius
       ACCESS read-only
       STATUS mandatory
       DESCRIPTION
           "The current measurement of the testpoint being instrumented."
       ::= { ciscoEnvMonTemperatureStatusEntry 3 }
So, ciscoEnvMonTemperatureStatusValue is a gauge32 value (gauge32 is
defined elsewhere but I didn't even bother to look it up) and equals
"ciscoEnvMonTemperatureStatusEntry.3"

Go back and find out how "ciscoEnvMonTemperatureStatusEntry" is built:
    ciscoEnvMonTemperatureStatusEntry OBJECT-TYPE
    ::= { ciscoEnvMonTemperatureStatusTable 1 }

We know: ciscoEnvMonTemperatureStatusTable.1.3

Just keep doing this:
Lookup ciscoEnvMonTemperatureStatusTable and find ciscoEnvMonObjects.3
Lookup ciscoEnvMonObjects to find ciscoEnvMonMIB.1

We know:
   ciscoEnvMonTemperatureStatusValue 
== ciscoEnvMonTemperatureStatusEntry.3
== ciscoEnvMonTemperatureStatusTable.1.3
== ciscoEnvMonObjects.3.1.3
== ciscoEnvMonMIB.1.3.1.3
== 1.3.6.1.4.1.9.9.13.1.3.1.3

Do snmpwalk on the device:
[alex at home /home/alex]$ snmpwalk router public .1.3.6.1.4.1.9.9.13.1.3.1.3
   enterprises.Cisco.ciscoMgmt.13.1.3.1.3.1 = Gauge: 23
   enterprises.Cisco.ciscoMgmt.13.1.3.1.3.2 = Gauge: 27
   enterprises.Cisco.ciscoMgmt.13.1.3.1.3.3 = Gauge: 31
   enterprises.Cisco.ciscoMgmt.13.1.3.1.3.4 = Gauge: 23
   enterprises.Cisco.ciscoMgmt.13.1.3.1.3.5 = Gauge: 28
   enterprises.Cisco.ciscoMgmt.13.1.3.1.3.6 = Gauge: 31
It works. As you can see, the OID describes the variable completely.
You can also see the so called instance (the 1 or 2 ... or 6) appended
to the OID.  In the same mib file other variables are described such
as "ciscoEnvMonVoltageStatusDescr" which is "ciscoEnvMonMIB.1.3.1.2"

I decide that I need to monitor the second and fifth instances to I
use them for MRTG like this (line wrapped for readability):
   Target[temp]: \
   1.3.6.1.4.1.9.9.13.1.3.1.3.2&1.3.6.1.4.1.9.9.13.1.3.1.3.5 \
   :public at router
Remember that it is a gauge value!!! Therefore:
   Options[temp]: gauge

Apply the usual stuff as found in any mrtg config file and it should
work, provided that the device knows of this OID.  If it doesn't work
using snmpwalk, it doesn't work using MRTG.

HTH,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list