Modify

Opened 4 years ago

Last modified 3 years ago

#14052 new defect

snmpd doesn't work without swap

Reported by: theos@… Owned by: developers
Priority: normal Milestone: Attitude Adjustment 12.09.1
Component: packages Version: Trunk
Keywords: Cc:

Description

The net-snmpd package in OpenWRT collects statistics on the virtual memory system. It does this by reading /proc/vmstat. It's common in OpenWRT to compile the kernel without swap support. If I install snmpd and direct the log to somewhere I can see it, then every 5 seconds it emits lines like this:

Aug 17 23:46:53 openwrt daemon.err snmpd[14959]: No pgpgin line in /proc/vmstat
Aug 17 23:46:53 openwrt daemon.err snmpd[14959]: No pgpgout line in /proc/vmstat
Aug 17 23:46:53 openwrt daemon.err snmpd[14959]: No pswpin line in /proc/vmstat
Aug 17 23:46:53 openwrt daemon.err snmpd[14959]: No pswpout line in /proc/vmstat

So, after digging around, I discovered that the MIB module that's generating that error is the hardware/cpu module, and the repeated error message is from a missing first=0 line the end of the _cpu_load_swap_etc function in agent/mibgroup/hardware/cpu/cpu_linux.c. When I add that line and reinstall libnetsnmp, the error messages show up only once.

The situation is also surprising because "hardware" is on the list of excluded MIB modules.

Another anomaly is that the downloaded snmpd didn't respond to requests. I don't have a procedure to discover why. Could be a red herring.

Attachments (1)

800-hardwarecpu.patch (204 bytes) - added by theos@… 4 years ago.
I guess nobody at net-snmp ever ran a computer without swap.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by theos@…

I guess nobody at net-snmp ever ran a computer without swap.

comment:1 Changed 4 years ago by anonymous

Hi,

the only workaround I could found (really dirty) is to completely suppress logging. I also tried to use "swap -1" but it had no effect.

Actually, the startup script runs snmpd -C -c /opt/etc/snmp/snmpd.conf -Ln and will no longer flood the usb stick.

Debian has the same issue: have a look at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569009

comment:2 Changed 3 years ago by anonymous

Thanks, worked perfect for me.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.