[mrtg] [SNMPv3] SNMPopen failed: Received usmStatsWrongDigests.0 Report-PDU

"Daniel Schröter" d.schroeter at gmx.net
Tue Mar 27 15:02:57 CEST 2007


Hello,

I can not use mrtg (2.15.1) SNMPv3 with an Loadbalancer from F5. Version v2c works fine and I can also use the commandline version snmpget with version 3.

With SNMPv2c it looks like this:
$ snmpget -v2c -c public 10.1.2.3 .1.3.6.1.2.1.2.2.1.10.5 .1.3.6.1.2.1.2.2.1.16.5
IF-MIB::ifInOctets.5 = Counter32: 1358615414
IF-MIB::ifOutOctets.5 = Counter32: 3064220214

The config line is:
Target[10.1.2.3_5]: .1.3.6.1.2.1.2.2.1.16.5&.1.3.6.1.2.1.2.2.1.10.5:public at 10.1.2.3:::::2

And starting mrtg (with debugging of snmpo and base) gives the following:
$ LANG=C perl -w ~/usrlocal/bin/mrtg --lock-file /home/user/tmp/mrtg ~/mrtg.cfg
--base: Creating Lockfiles /home/user/tmp/mrtg,/home/user/tmp/mrtg_14451
--base: Reading Config File: /home/user/mrtg.cfg
--base: SNMP V3 libraries found, SNMP V3 enabled.
--base: Reading Interface Config cache
--base: Checking Config File
--base: Loading default Locale
--base: Starting main Loop
--base: Populate Target object by polling SNMP and external Datasources
--snpo: run snmpget from .1.3.6.1.2.1.2.2.1.16&.1.3.6.1.2.1.2.2.1.10:public at 10.1.2.3
--snpo: simple If: .5
--snpo: simple If: .5
--snpo: SNMPGet from public at 10.1.2.3:::::2 -- .1.3.6.1.2.1.2.2.1.16.5,.1.3.6.1.2.1.2.2.1.10.5,sysUptime,sysName

--------------------
snmpget(public at 10.1.2.3:::::2:v4only,HASH(0x8a8546c),.1.3.6.1.2.1.2.2.1.16.5 .1.3.6.1.2.1.2.2.1.10.5 sysUptime sysName)


--snpo: SNMPfound -- '3064037208', '1358395517', 'undef', 'undef'
--base: Act on Router/Target 10.1.2.3_5
--base: Get Current values: in:3064037208, out:1358395517, up:undef, name:undef, time:1174997940
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Exit main Loop
--base: Remove Lock Files
--base: Store Interface Config Cache


Using SNMPv3 on the commandline looks fine:
$ snmpget -v3 -c public -a SHA -A <deleted> -u <deleted> -X <deleted> -x DES -l authPriv 10.1.2.3 .1.3.6.1.2.1.2.2.1.10.5 .1.3.6.1.2.1.2.2.1.16.5
IF-MIB::ifInOctets.5 = Counter32: 1358636239
IF-MIB::ifOutOctets.5 = Counter32: 3064237166

Changing the config file for v3:
Target[10.1.2.3_5]: .1.3.6.1.2.1.2.2.1.16.5&.1.3.6.1.2.1.2.2.1.10.5:public at 10.1.2.3:::::3
SnmpOptions[10.1.2.3_5]: authkey=>'<deleted>',privKey=>'<deleted>',authprotocol=>'SHA',username=>'<deleted>',privprotocol=>'DES'

And I get an error in SNMPopen:
$ LANG=C perl -w ~/usrlocal/bin/mrtg --lock-file /home/user/tmp/mrtg ~/mrtg.cfg                   --base: Creating Lockfiles /home/user/tmp/mrtg,/home/user/tmp/mrtg_14486
--base: Reading Config File: /home/user/mrtg.cfg
--base: SNMP V3 libraries found, SNMP V3 enabled.
--base: Reading Interface Config cache
--base: Checking Config File
--base: Loading default Locale
--base: Starting main Loop
--base: Populate Target object by polling SNMP and external Datasources
--snpo: run snmpget from .1.3.6.1.2.1.2.2.1.16&.1.3.6.1.2.1.2.2.1.10:public at 10.1.2.3
--snpo: simple If: .5
--snpo: simple If: .5
--snpo: SNMPGet from public at 10.1.2.3:::::3 -- .1.3.6.1.2.1.2.2.1.16.5,.1.3.6.1.2.1.2.2.1.10.5,sysUptime,sysName

--------------------
snmpget(public at 10.1.2.3:::::3:v4only,HASH(0x8a854a8),.1.3.6.1.2.1.2.2.1.16.5 .1.3.6.1.2.1.2.2.1.10.5 sysUptime sysName)


SNMPopen failed: Received usmStatsWrongDigests.0 Report-PDU with value 2 during synchronization at /home/user/usrlocal/bin/mrtg line 2150
SNMPGET Problem for public at 10.1.2.3:::::3:v4only at /home/user/usrlocal/bin/mrtg line 2150
--snpo: SNMPfound -- 'undef', 'undef', 'undef', 'undef'
--base: Act on Router/Target 10.1.2.3_5
2007-03-27 14:25:06: ERROR: Target[10.1.2.3_5][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2007-03-27 14:25:06: ERROR: Target[10.1.2.3_5][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
--base: Get Current values: in:undef, out:undef, up:undef, name:undef, time:1174998306
--base: Create Graphics
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Exit main Loop
--base: Remove Lock Files
--base: Store Interface Config Cache


The value increase with every mrtg start.

For more debugging I inseret in Net_SNMP_util.pm in the function snmpopen in front of the existing line:
    ($sess, $tmp) = Net::SNMP->session(%args);
the following code
    foreach (keys %args) {
        printf ("Debugging: Key: $_\tValue: $args{$_} \n");
    }

So I got the following output:
[...]
--------------------
snmpget(public at 10.1.2.3:::::3:v4only,HASH(0x8681c8c),.1.3.6.1.2.1.2.2.1.16.5 .1.3.6.1.2.1.2.2.1.10.5 sysUptime sysName)


Debugging: Key: -version        Value: 3
Debugging: Key: -hostname       Value: 10.1.2.3
Debugging: Key: -username       Value: <deleted>
Debugging: Key: -authprotocol   Value: SHA
Debugging: Key: -privprotocol   Value: DES
Debugging: Key: -privKey        Value: <deleted>
Debugging: Key: -domain		Value: udp/ipv4
Debugging: Key: -authkey        Value: <deleted>
SNMPopen failed: Received usmStatsWrongDigests.0 Report-PDU with value 3 during synchronization at /home/user/usrlocal/bin/mrtg line 2150
[...]

Any ideas what I'm doing wrong?
Why it's working with snmpget but not in the mrtg?

Bye

	Daniel
-- 
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out



More information about the mrtg mailing list