• About Me
  • Impressum
  • Privacy
  • Fun Stuff

№42

... it's better to have good questions

Cleaner log with Docker and SNMP

May 19, 2017 1 min read Ronny Trommer

Centralizing logs is important as soon you have more than 2 servers. In my environment the bare metal is monitored with Net-SNMP and my services are deployed as containers with Docker. All system logs are sent to a Graylog2 instance and I quickly noticed a few ugly entries caused by snmpd.

Cannot statfs /run/docker/netns/...: Permission denied

You will notice a few of them. First approach try to increase the logging level in /etc/default/snmpd from SNMP daemon with

SNMPDOPTS='-Ls3d -Lf /dev/null -u snmp -g snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid'

The man page from Net-SNMP described the logging and I’ve increased with -Ls3d the level to “Error” instead of “Warning”, but it didn’t help. I researched in the web and found this topic in Red Hats Bugzilla.

It turns out snmpd is reading /proc/mount and runs statfs and logs an error. One of the authors in the comment section found a solution to use rsyslog filtering this type of message with:

if $programname == 'snmpd' and $msg contains 'statfs' then {
    stop
}

The result is now a much cleaner log with less garbage.

Happy Logging

Snmp Docker Monitoring
Latest posts
  • Streaming telemetry with gNMI
  • Go away or I replace you with a Makefile
  • SNMP Proxy ... wait what?
  • Hackathon on BGP monitoring using BMP in OpenNMS
  • Dealing with secrets in OpenNMS Horizon
  • Building container images for OpenNMS
  • Hello Containerlab with Orbstack
  • OpenNMS Horizon with RRDtool
  • Demystifying iplike in OpenNMS Horizon
  • JniPing vs. JnaPing
Categories
  • OpenNMS (27)
  • Technology (24)
  • How-To (21)
  • Monitoring (13)
  • Tutorial (8)
  • Events (6)
  • Open-Source (6)
  • Container (5)
  • BGP (2)
  • Containers (2)
Social media
© 2025 made in 🇪🇺 by Ronny Trommer with ❤️ for Open Source
Bilberry Hugo Theme