1

I am setting up MRTG on a Raspberry Pi 3+ B. When I try to run MRTG, it fails with this error:

pi@pi:/etc $ sudo mrtg
SNMP Error:
no response received
SNMPv1_Session (remote host: "pi" [127.0.1.1].161)
                  community: "public"
                 request ID: 2020852752
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/share/perl5/SNMP_util.pm line 497.
SNMPGET Problem for .1.3.6.1.2.1.25.3.3.1.2.768 1.3.6.1.2.1.25.1.7.0 sysUptime sysName on public@pi::::::v4only
 at /usr/bin/mrtg line 2435.
2020-06-05 11:39:30: WARNING: skipping because at least the query for .1.3.6.1.2.1.25.3.3.1.2.768 on  pi did not succeed
2020-06-05 11:39:30: WARNING: no data for .1.3.6.1.2.1.25.3.3.1.2&1.3.6.1.2.1.25.1.7:public@pi. Skipping further queries for Host pi in this round.
2020-06-05 11:39:40: ERROR: Target[pi-cpu][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2020-06-05 11:39:40: ERROR: Target[pi-cpu][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data

Question

I presume the OID is wrong. Where do I find the OIDs of the CPU, memory, network interfaces ...?

Environment

1) Raspbian GNU/Linux 10 (buster)

2) NET-SNMP version: 5.7.3

3) lighttpd/1.4.53 (ssl) - a light and fast webserver

4) /etc/mrtg.conf

WorkDir: /var/www/html/mrtg
WriteExpires: Yes
Title[^]: Traffic Analysis for
WorkDir: /var/www/html/mrtg

EnableIPv6: no
Target[pi-CPU]: .1.3.6.1.2.1.25.3.3.1.2.768&1.3.6.1.2.1.25.1.7.0:public@pi
MaxBytes[pi-CPU]: 100
YLegend[pi-CPU]: CPU %
ShortLegend[pi-CPU]: %
LegendI[pi-CPU]: CPU
Legend1[pi-CPU]: CPU usage
Options[pi-CPU]: integer, gauge, nopercent, growright, unknaszero, noo
Title[pi-CPU]: Raspberry Pi 3 CPU load
PageTop[pi-CPU]: <H1>Raspberry Pi 3 - CPU load</H1>

Tests

Checking out the OID .1.3.6.1.2.1.25.3.3.1.2.768

pi@pi:/etc $ snmpget -v 1 -c public localhost .1.3.6.1.2.1.25.3.3.1.2.768
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.25.3.3.1.2.768

Checking snmpwalk:

pi@pi:~ $ snmpwalk  -c public -v 1 localhost .1.3
iso.3.6.1.2.1.1.1.0 = STRING: "Linux pi 4.19.118-v7+ #1311 SMP Mon Apr 27 14:21:24 BST 2020 armv7l"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (1153304) 3:12:13.04
iso.3.6.1.2.1.1.4.0 = STRING: "Me <me@example.org>"
iso.3.6.1.2.1.1.5.0 = STRING: "pi"
iso.3.6.1.2.1.1.6.0 = STRING: "Sitting on the Dock of the Bay"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72
iso.3.6.1.2.1.1.8.0 = Timeticks: (25) 0:00:00.25
iso.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.6.3.11.3.1.1
iso.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.6.3.15.2.1.1
iso.3.6.1.2.1.1.9.1.2.3 = OID: iso.3.6.1.6.3.10.3.1.1
iso.3.6.1.2.1.1.9.1.2.4 = OID: iso.3.6.1.6.3.1
iso.3.6.1.2.1.1.9.1.2.5 = OID: iso.3.6.1.6.3.16.2.2.1
iso.3.6.1.2.1.1.9.1.2.6 = OID: iso.3.6.1.2.1.49
iso.3.6.1.2.1.1.9.1.2.7 = OID: iso.3.6.1.2.1.4
iso.3.6.1.2.1.1.9.1.2.8 = OID: iso.3.6.1.2.1.50
iso.3.6.1.2.1.1.9.1.2.9 = OID: iso.3.6.1.6.3.13.3.1.3
iso.3.6.1.2.1.1.9.1.2.10 = OID: iso.3.6.1.2.1.92
iso.3.6.1.2.1.1.9.1.3.1 = STRING: "The MIB for Message Processing and Dispatching."
iso.3.6.1.2.1.1.9.1.3.2 = STRING: "The management information definitions for the SNMP User-based Security Model."
iso.3.6.1.2.1.1.9.1.3.3 = STRING: "The SNMP Management Architecture MIB."
iso.3.6.1.2.1.1.9.1.3.4 = STRING: "The MIB module for SNMPv2 entities"
iso.3.6.1.2.1.1.9.1.3.5 = STRING: "View-based Access Control Model for SNMP."
iso.3.6.1.2.1.1.9.1.3.6 = STRING: "The MIB module for managing TCP implementations"
iso.3.6.1.2.1.1.9.1.3.7 = STRING: "The MIB module for managing IP and ICMP implementations"
iso.3.6.1.2.1.1.9.1.3.8 = STRING: "The MIB module for managing UDP implementations"
iso.3.6.1.2.1.1.9.1.3.9 = STRING: "The MIB modules for managing SNMP Notification, plus filtering."
iso.3.6.1.2.1.1.9.1.3.10 = STRING: "The MIB module for logging SNMP Notifications."
iso.3.6.1.2.1.1.9.1.4.1 = Timeticks: (14) 0:00:00.14
iso.3.6.1.2.1.1.9.1.4.2 = Timeticks: (14) 0:00:00.14
iso.3.6.1.2.1.1.9.1.4.3 = Timeticks: (14) 0:00:00.14
iso.3.6.1.2.1.1.9.1.4.4 = Timeticks: (14) 0:00:00.14
iso.3.6.1.2.1.1.9.1.4.5 = Timeticks: (14) 0:00:00.14
iso.3.6.1.2.1.1.9.1.4.6 = Timeticks: (15) 0:00:00.15
iso.3.6.1.2.1.1.9.1.4.7 = Timeticks: (15) 0:00:00.15
iso.3.6.1.2.1.1.9.1.4.8 = Timeticks: (15) 0:00:00.15
iso.3.6.1.2.1.1.9.1.4.9 = Timeticks: (25) 0:00:00.25
iso.3.6.1.2.1.1.9.1.4.10 = Timeticks: (25) 0:00:00.25
iso.3.6.1.2.1.25.1.1.0 = Timeticks: (1155270) 3:12:32.70
iso.3.6.1.2.1.25.1.2.0 = Hex-STRING: 07 E4 06 05 0B 38 32 00 2D 04 00 
iso.3.6.1.2.1.25.1.3.0 = INTEGER: 393216
iso.3.6.1.2.1.25.1.4.0 = STRING: "coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2"
iso.3.6.1.2.1.25.1.5.0 = Gauge32: 4
iso.3.6.1.2.1.25.1.6.0 = Gauge32: 157
iso.3.6.1.2.1.25.1.7.0 = INTEGER: 0
End of MIB

Checking out an OID extracted from snmpwalk:

pi@pi:~ $ snmpget -v 1 -c public localhost iso.3.6.1.2.1.1.9.1.4.1
iso.3.6.1.2.1.1.9.1.4.1 = Timeticks: (14) 0:00:00.14

Checking the web page:

enter image description here

2
1

My bad. I omitted this single step while configuring snmpd:

Once that installs, the /etc/snmp/snmpd.conf needs to be edited. Open that file in your text editor of choice and change the line:

#rocommunity public localhost

to

rocommunity public localhost

After correcting the error, I run again

sudo cfgmaker public@localhost > /etc/mrtg.cfg
sudo indexmaker /etc/mrtg.cfg > /var/www/html/mrtg/index.html
sudo mrtg

[I'm using lighttpd instead of apache. Hence the path /var/www/html/mrtg]

And voila, everything works! enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.