[mrtg] Re: MRTG and Grand Junction (Cisco Catalyst 1700) switches

alex at ergens.op.Het.Net alex at ergens.op.Het.Net
Wed Apr 12 21:45:11 MEST 2000

Timothy J. Massey wrote:
> The following command works:
> Target[]: 1:public at
> From reading the doc, it seems like that command is supposed to return
> the statistics for the first port of the device.  That's all well and
> good, but there's nothing attached to the first port.  I want to
> monitor, say, the second port.

It is supposed to give you the statistics for interface #1.  This is not
the same as the externally accessable port which has a descriptive label
next to it saying "1".  In fact, I shouldn't say "interface #1" either,
this is technically speaking incorrect.  For the purpose of this mail it
is close enough to the truth.

Obviously you are not only new to MRTG, you're also new to SNMP.  Find
yourself some good beginners guide to SNMP if you don't understand what
I write next.

The counters (and more) that are kept in the device are made available
to you using SNMP.  All of this information together is defined as the
MIB (management information base).  Each available object in this MIB
is described by an OID (object identifier) and an instance.  For example,
the inbound interface statistics are available using the following OID:
"" or
This OID has multiple instances, starting by number 1.  If there are
more interfaces, you'll get more instances.

For a router, the complete table might look like:
interfaces.ifTable.ifEntry.ifInOctets.1 = 95592607
interfaces.ifTable.ifEntry.ifInOctets.2 = 52565778
interfaces.ifTable.ifEntry.ifInOctets.3 = 246029
interfaces.ifTable.ifEntry.ifInOctets.4 = 120254662
interfaces.ifTable.ifEntry.ifInOctets.5 = 0

In this case, there are 5 instances.

I query this device using a utility called "snmpwalk".  There is
a similar tool for NT called "snmputil.exe".  RTFM for the exact
usage, for me the next is working:

snmpwalk router public .
interfaces.ifTable.ifEntry.ifDescr.1 = "BRI0: B-Channel 1"
interfaces.ifTable.ifEntry.ifDescr.2 = "BRI0: B-Channel 2"
interfaces.ifTable.ifEntry.ifDescr.3 = "BRI0" Hex: 42 52 49 30
interfaces.ifTable.ifEntry.ifDescr.4 = "Ethernet0"
interfaces.ifTable.ifEntry.ifDescr.5 = "Loopback0"

If you define a target inside MRTG as "1:public at router" you would
monitor instance 1, which is channel 1 on my ISDN interface.
On your hub it will be something completely different.  Probably it
will be the "general ethernet port connector" and it might be the only
instance in this part of the MIB.

> http://www.cisco.com/univercd/cc/td/doc/product/lan/cat1700/c1700/c17inb
> nd.htm), it gives me an entire list of SNMP codes that I can use. 
> Of course, the string swPortRxOctets (counter) doesn't give me what I
> need.  I need that string of dotted numbers.
> How can I figure out what SNMP numeric codes my switch is listening for
> and what they mean?  Is there anyone else out there with a Grand
> Junction/Cisco 1700 switch that could tell me?

Search the mrtg mail archive for "mib browser" or something similar.
If everything works well, you should be able to use the file called
"CAT1700.mib" which is, according to the link you included, available
to you.

You could also do it the hard way.  You'd still need the MIB file,
however you can parse it yourself.  Start from the place where the
desired OID is defined.  It will give you the previous node in the
tree.  Look back in the document and find that previous node.  Repeat
until you've reached a known prefix which will allow you to complete
the OID.  This requires being able to read the ASN.1 language. 
For instance:

Want to know "ifInOctets".
Search the correct file, find:
                  ifInOctets OBJECT-TYPE
                          SYNTAX  Counter
                          ACCESS  read-only
                          STATUS  mandatory
                          ::= { ifEntry 10 }
so the OID ends with ".10".  Now find ifEntry:
                  ifEntry OBJECT-TYPE
                          SYNTAX  IfEntry
                          ACCESS  read-write
                          STATUS  mandatory
                          ::= { ifTable 1 }
so the OID must end in ".1.10".
Repeat. End up with and query this using the
correct instance.  Done.

 / 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 |
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |

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

More information about the mrtg mailing list