-
Problem report
-
Resolution: Fixed
-
Major
-
6.0.1
-
None
-
Sprint candidates
Steps to reproduce:
- Install dockerised zabbix-snmptraps service (alpine-based version)
Result:
The logrotate rule for file '/var/lib/zabbix/snmptraps/snmptraps.log' has syntax error:
bash-5.1# cat /etc/logrotate.d/zabbix_snmptraps # https://support.zabbix.com/browse/ZBX-9858 /var/lib/zabbix/snmptraps/snmptraps.log { missingok daily rotate 0 minsize 50M notifempty su zabbix zabbix }
E.g.
bash-5.1# logrotate -d /etc/logrotate.d/zabbix_snmptraps WARNING: logrotate in debug mode does nothing except printing debug messages! Consider using verbose mode (-v) instead if this is not what you want. reading config file /etc/logrotate.d/zabbix_snmptraps error: /etc/logrotate.d/zabbix_snmptraps:6 unknown unit 'y' error: found error in /var/lib/zabbix/snmptraps/snmptraps.log , skipping removing last 1 log configs Reading state from file: /var/lib/logrotate.status Allocating hash table for state file, size 64 entries Creating new state Creating new state Handling 0 logs
Expected:
notifempty entry (l.6) should be in a line on its own, so that this rule is correctly parsed by logrotate:
/var/lib/zabbix/snmptraps/snmptraps.log {
missingok
daily
rotate 0
minsize 50M
notifempty
su zabbix zabbix
}