3

I normally do snmptraps and other net-snmp commands without problems with root session, but when i try to execute same commads with a normal user i obtain follow errors:

Cannot rename /var/lib/net-snmp/snmpapp.conf to /var/lib/net-snmp/snmpapp.0.conf

Cannot unlink /var/lib/net-snmp/snmpapp.conf

read_config_store open failure on /var/lib/net-snmp/snmpapp.conf

read_config_store open failure on /var/lib/net-snmp/snmpapp.conf

read_config_store open failure on /var/lib/net-snmp/snmpapp.conf

I try to search for a .conf file for add the necessary permisions to all net-snmp to a normal user but i don't find it exactly what to do, for fixing this problem.

Thank you for your help.

2 Answers2

6

I have faced similar issue and resolved it by following a discussion at http://sourceforge.net/p/net-snmp/bugs/1706/. I think the pith of the problem has to do with running the snmptrap command with an unprivileged user. In which case a user specific configuration should be created by adding the following line:

persistentDir /home/user/.snmp_persist

in ~/.snmp/snmp.conf

After you run snmptrap you should see something similar to:

Creating directory: /home/user/.snmp_persist

I hope this helps.

taz
  • 61
1

A quick look at the snmptrapd man page shows the following:

Note: the default is to listen on UDP port 162 on all IPv4 interfaces. Since 162 is a privileged port, snmptrapd must typically be run as root.

I am not familiar with snmpapp.conf but I would start with looking at the permissions for /var/lib/net-snmp/snmpapp.conf. What distro are you running and are you using any sort of frontend to SNMP?

chuck
  • 534