snmpd cannot statfs directory

12,020

The following setting is in /etc/default/snmpd. The Permission Denied message goes away when I change to Ls3d from Lsd, so I assume that it is related to log level.

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

I found some information about snmpd log level in this question on ServerFault.

Share:
12,020

Related videos on Youtube

lrussell123
Author by

lrussell123

Updated on September 18, 2022

Comments

  • lrussell123
    lrussell123 over 1 year

    On Ubuntu 16.04, I'm running snmpd for monitoring. In my syslog, I'm seeing the following message every 5 minutes:

    Sep 23 11:10:11 kvm snmpd[3427]: Cannot statfs /sys/kernel/debug/tracing: Permission denied
    

    The snmp daemon is being run under the snmp user. /sys/kernel/debug has permissions:

    drwx------ 27 root root 0 Sep 22 21:34 .
    

    So, this error makes sense. What doesn't make sense, however, is why snmpd is trying to stat this directory. Any thoughts?

  • Travis Runyard
    Travis Runyard over 4 years
    Most newer systems are running systemd, therefore the file which needs the same change is the snmpd.service unit file: /usr/lib/systemd/system/snmpd.service After you're done editing the file you'll need to reload like this: systemctl daemon-reload
  • mike
    mike about 2 years
    Tried this on Ubuntu Server 20.04.3 and it didn't help i'm still getting this errors: snmpd[2959]: Cannot statfs /sys/kernel/debug/tracing: Permission denied
  • David Buttrick
    David Buttrick about 2 years
    Changing the logging level will cause you to no longer see other messages that you might need to see. I'm not looking for a solution like this. There is some part of the snmpd that is reading the /proc/mounts and doing a statfs() on entries that it finds there. I'm looking for ways to prevent this behavior and have not had luck finding a solution or workaround. For me the problem is worst on hosts that are running docker.