[mrtg] Re: SNMP getbulk and Sun servers

Mike Mitchell Mike.Mitchell at sas.com
Wed Jun 21 00:49:46 MEST 2000


The problem is probably because MRTG uses SNMP version 1 by default to
query the data.  You need to tell MRTG to use SNMP version 2c for those
variables.  There are three steps you need to do to do this.  The
first step is to replace the SNMP_util.pm, SNMP_session.pm, and BER.pm
modules shipped with MRTG with the latest version from Simon Leinen,
available at http://www.switch.ch/misc/leinen/snmp/perl.  The current
version is 0.77, while the version shipped with MRTG 2.8.12 is 0.71.
Version 0.77 has support for SNMP version 2c in the snmpget functions.

The second step is to tell MRTG to actually use SNMP version 2c for its
queries.  To do this, change your target definition from "torws105p" to
"torws105p:::::2c"  I suspect your full target definition looks
something like:

   Target[mem]:krTotPhyMemAvail&krTotPhyMemAvail:public at torws105p  

Change it to
   
   Target[mem]:krTotPhyMemAvail&krTotPhyMemAvail:public at torws105p:::::2c

This uses the default SNMP port, timeout, retries, and backoff values, but
changes the SNMP type from version 1 to version 2c.

The third and final step is to modify MRTG itself.  Unfortunetly the parsing
routine MRTG uses doesn't like the "2c" at the end. It is expecting only
numbers, not numbers and letters, so we have to lift that restriction.
Go to about line number 683 in mrtg, or search for "TARGNEW" in the actual
mrtg perl script.  About five lines above TARGNEW you should see a line like

  s/(-?)([a-z0-9\.&\/!-]+):([^\s]+)\@([-a-z0-9_\.]+(:[0-9.]*)*(?=[\s\+\/\*]|$)/$pr$&$po/i)

It is the only line that starts "s/" around there, so it should be easy to
find. Change the part that says +(:[0-9.]*)* to say +(:[0-9c.]*)*
You should be all ready to go.

-----Original Message-----
From: MacMillan, Bruce [mailto:Bruce.MacMillan at CIBC.CA]
Sent: Thursday, June 01, 2000 1:11 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] SNMP getbulk and Sun servers


     Hi there!
     
     I'm having some trouble setting up MRTG to poll my Sun servers.
     
     I am using Sun's SMC product and using a MIB browsing tool I am able 
     to do an SNMP Getbulk to extract information from their MIBS.
     
     For example:
     
     OID 1.3.6.1.4.1.42.2.12.2.2.12.6.1 krTotPhyMemAvail can be polled with 
     the SNMP getbulk and will return the correct information.
     
     However, when I try to use MRTG to graph the results it bombs.  
     
     SNMP Error:
     Received SNMP response with error code
       error status: noSuchName
       index 1 (OID: 1.3.6.1.4.1.42.2.12.2.2.12.6.1)
     SNMPv1_Session (remote host: "torws105p" [167.26.40.65].161
                       community: "public"
                      request ID: 953893033
                     PDU bufsize: 8000 bytes
                         timeout: 2s
                         retries: 5
                         backoff: 1)
     
     I believe this is because MRTG is just using a get, rather than a 
     getbulk.  I say this because when I use my browser tool to just do a 
     get on the same OID it also fails.  It will only work with the 
     getbulk.
     
     Is there any way of changing this?
     
     Thanks,
     Bruce

--
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

--
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