In case the collector daemon is filling up your /var/log/messages with an endless number of lines containing SNMP trap data, you can easily fix this by creating a custom collector service without Syslog options enabled.
The resolution is to change some of the command line arguments passed to the collector daemon. Instead of -Lsd we want to use -Lf /some/place/for/logs/trapper-collector.log.
Some things to keep in mind:
- The new log file is not log rotated by default. If you need rotation, add a new log rotation setting file into the /etc/logrotation.d/ directory.
- Disable the original service and enable the new one instead.
- This will not stop Trapper's processor daemon from logging to /var/log/messages. But this change will only affect collector.
The following instructions are for EL7:
cp collector.service collector-nosyslog.service
sed -i 's/.conf\ -A\ -Lsd\ -f/.conf\ -A -Lf\ \/path\/to\/log\/file/g' collector-nosyslog.service # Replace placeholder path with real path
systemctl disable --now collector.service && systemctl enable --now collector-nosyslog.service