[mrtg] supported target syntaxes

Brian A. Seklecki lavalamp at spiritual-machines.org
Tue Jul 3 16:06:55 CEST 2007


All:

The "target" line is just passed through to the underlying SNMP library in 
the same fashion that argv[] is parsed by snmpget(1), correct?


The following are identical:

- ".1.3.6.1.4.1.64512.1.3.1.0"
- "OPENBSD-PF-MIB::count.0"
- ".iso.org.dod.internet.private.enterprises.openBSD.pfMIBObjects.stateTable.count.0"

This is after:

export 
MIBS="+OPENBSD-BASE-MIB:OPENBSD-PF-MIB:OPENBSD-CARP-MIB:OPENBSD-SENSORS-MIB"


$ snmpget -v2c -c * ha12 
.iso.org.dod.internet.private.enterprises.openBSD.pfMIBObjects.stateTable.count.0 
OPENBSD-PF-MIB::count.0 = Gauge32: 56


$ snmpget -v2c -c * ha12 .1.3.6.1.4.1.64512.1.3.1.0
OPENBSD-PF-MIB::count.0 = Gauge32: 75

$  snmpget -v2c -c * ha12 OPENBSD-PF-MIB::count.0
OPENBSD-PF-MIB::count.0 = Gauge32: 68


So shouldn't any of these be valid if "EnableSnmpV3: yes" thus using 
PERL::Net-SNMP ?

Also: LoadMIBs: 
/usr/local/share/snmp/mibs/SNMPv2-SMI.txt,/usr/local/share/snmp/mibs/SNMPv2-CONF.txt,/home/seklecki/.snmp/mibs/OPENp/mibs/OPENBSD-CARP-MIB.txt,/home/seklecki/.snmp/mibs/OPENBSD-PF-MIB.txt


Here is tcpdump from snmpget(1):

IP vlan12.pr0.lab00.pitbpa0.priv.collaborativefusion.com.snmp > 
rampage.lab00.pitbpa0.priv.collaborativefusion.com.57928:  C=* 
GetResponse(33)  E:64512.1.3.1.0=68 09:51:02.340142 IP

rampage.lab00.pitbpa0.priv.collaborativefusion.com.57928 > 
ha0.lab00.pitbpa0.priv.collaborativefusion.com.snmp:  C=* GetRequest(32) 
E:64512.1.3.1.0

--------------

64512.1.3.1.0 seems right.

--------------

However, MRTG only seems to accept the OID:

With Fully Qualified OID:

2007-07-03 09:53:45: WARNING: Expected a number but got 'noSuchObject'
2007-07-03 09:53:45: WARNING: Expected a number but got 'noSuchObject'

2007-07-03 09:53:46: ERROR: Target[pr0_pf_states][_IN_] 
'.iso.org.dod.internet.private.enterprises.openBSD.pfMIBObjects.stateTable.count.0&.iso.org.dod.internet.private.enterprises.openBSD.pfMIBObjects.stateTable.count. 
$target->[6]{$mode} ' (eval): syntax error at (eval 29) line 1, near "."

2007-07-03 09:53:46: ERROR: Target[pr0_pf_states][_OUT_] 
'.iso.org.dod.internet.private.enterprises.openBSD.pfMIBObjects.stateTable.count.0&.iso.org.dod.internet.private.enterprises.openBSD.pfMIBObjects.stateTable.count. 
$target->[6]{$mode} ' (eval): syntax error at (eval 30) line 1, near "."

**** The wrong OID is requested:

10:01:43.180981 IP 
rampage.lab00.pitbpa0.priv.collaborativefusion.com.51627 > 
ha0.lab00.pitbpa0.priv.collaborativefusion.com.snmp:  C=*
GetRequest(74)  31.1.1.1.6.0 31.1[|snmp]


31.1.1.1.6.0 31.1 != 64512.1.3.1.0



-------------------------------------------

With Abbrieviated OID:

Unknown SNMP var OPENBSD-PF-MIB at /usr/local/bin/mrtg line 2044
Unknown SNMP var OPENBSD-PF-MIB at /usr/local/bin/mrtg line 2044

SNMPGET Problem for count.0 OPENBSD-PF-MIB sysUptime sysName on 
:count.0:*@ha12:::::2:v4only : No response from remote host 'ha12' at 
/usr/local/bin/mrtg line 2044

2007-07-03 09:56:38: ERROR: Target[pr0_pf_states][_IN_] 'OPENBSD-PF-MIB:: 
$target->[6]{$mode} ' (warn): Bareword "MIB::" refers to nonexistent 
package at (eval 31) line 1.
2007-07-03 09:56:38: ERROR: Target[pr0_pf_states][_OUT_] 'OPENBSD-PF-MIB:: 
$target->[6]{$mode} ' (warn): Bareword "MIB::" refers to nonexistent 
package at (eval 32) line 1.


**** The wrong OID is requested (not the community is set to part of OID):


10:00:02.314865 IP 
rampage.lab00.pitbpa0.priv.collaborativefusion.com.64796 > 
ha0.lab00.pitbpa0.priv.collaborativefusion.com.snmp:  C=:count.0:* 
GetRequest(58)  E:64512.1.5.1.0 [|snmp]


My community string is replstrp here with asterisk (*)

OID_Cache.txt is eliminated between each request.

Am I being punished for getting greedy and trying to use non-numeric MIB 
entries?

l8*
 	-lava (Brian A. Seklecki - Pittsburgh, PA, USA)
 	       http://www.spiritual-machines.org/

     "Guilty? Yeah. But he knows it. I mean, you're guilty.
     You just don't know it. So who's really in jail?"
     ~Maynard James Keenan



More information about the mrtg mailing list