Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial

Installed snmpd snmptt snmp.

/ etc / default / snmpd

# This file controls the activity of snmpd # Don't load any MIBs by default. # You might comment this lines once you have the MIBs downloaded. export MIBS= # snmpd control (yes means start daemon). SNMPDRUN=yes # snmpd options (use syslog, close stdin/out/err). SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid' 

/etc/snmp/snmptt.ini

 mode =daemon net_snmp_perl_enable = 1 log_file = /var/log/snmptt/snmptt.log log_enable = 1 unknown_trap_log_enable = 1 unknown_trap_log_file = /var/log/snmptt/snmpttunknown.log 

/etc/snmp/snmptrapd.conf

 authCommunity log,execute,net public traphandle default snmptthandler 

Traps are not recorded at all, although they come by tcpdump.

If you run manually:

 sudo service snmpd stop sudo snmptrapd -f -L o 

then everything is recorded. And also in the logs:

 16:45:03 2017/04/18 SNMPTT v1.4 shutdown 16:45:03 2017/04/18 Total traps received=0,Total traps translated=0,Total traps ignored=0,Total unknown traps=0 16:45:04 2017/04/18 SNMPTT v1.4 started 16:45:04 2017/04/18 Loading /etc/snmp/snmptt.conf 16:45:04 2017/04/18 Finished loading 66 lines from /etc/snmp/snmptt.conf 16:45:04 2017/04/18 Loading 16:45:04 2017/04/18 Could not open configuration file: 16:45:04 2017/04/18 Changing to UID: snmptt (117) 

What am I doing wrong? Could not open configuration file: - tried to google, really did not find anything.

    2 answers 2

    Changing to UID: snmptt hints that it works from the user snmptt. Is the conf file (/etc/snmp/snmptt.ini) available for reading? Is / var / log / snmptt / writable?

    Just because you try from the root, he has more rights.

    • Is it enough to make chmod or assign owner (chown)? - Vladimir
    • one
      looking where. ON ini is better to do things (only not 666!), And it is better to assign the owner to the directory with logs. - Smithson
    • Did not help. codeshare.io/GApbRw when running snmptt - debug = 2 - Vladimir
    • one
      It does not suit the 66th line of the /etc/snmp/snmptt.conf file. Show this file. - Smithson
    • codeshare.io/GbebNq strange, I see nothing 66 line EDESC - Vladimir

    Startup helped with snmptrapd -On option