Any systemd guru's out there?
Running on CentOS7.
I'm having a problem with snmptrapd. When I start it from the commandline with: snmptrapd -Lf /var/log/snmp-traps.log --disableAuthorization=yes
it works just fine! I can send snmptraps from my routers to the server and they show up in the /var/log/snmp-traps.log file.
But when I kill the process, and start snmptrapd from systemd with:
systemctl start snmptrapd
it starts without any errors, runs as the root user, and listens on port 162, but the traps are not showing up in the snmp-traps.log file.
I had to modify 2 snmptrap config files to get it to start from systemd and run without errors...
/etc/sysconfig/snmptrapd
OPTIONS="-Lf /var/log/snmp-traps.log"
/etc/snmp/snmptrapd.conf
disableAuthorization yes
Here's an output from the status...
[root@splunk ~]# systemctl status snmptrapd
snmptrapd.service - Simple Network Management Protocol (SNMP) Trap Daemon.
Loaded: loaded (/usr/lib/systemd/system/snmptrapd.service; enabled)
Active: active (running) since Mon 2014-09-08 13:40:07 EDT; 4min 55s ago
Main PID: 5379 (snmptrapd)
CGroup: /system.slice/snmptrapd.service
└─5379 /usr/sbin/snmptrapd -Lf /var/log/snmp-traps.log -f
Sep 08 13:40:07
splunk.peak10.services.monetra.com systemd[1]: Starting Simple Network Management Protocol (SNMP) Trap Daemon....
Sep 08 13:40:07
splunk.peak10.services.monetra.com systemd[1]: Started Simple Network Management Protocol (SNMP) Trap Daemon..
[root@splunk ~]# netstat -anp |grep udp
udp 0 0
0.0.0.0:162 0.0.0.0:* 5379/snmptrapd
[root@splunk log]# ps -elf |grep trap
4 S root 5379 1 0 80 0 - 56186 poll_s 13:40 ? 00:00:00 /usr/sbin/snmptrapd -Lf /var/log/snmp-traps.log -f