Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-20768

Incorrect logrotate rule for snmptraps.log in containerised snmptrapd service

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 6.0.1
    • None

      Steps to reproduce:

      1. 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
      }
      

       

            zabbix.dev Zabbix Development Team
            CaveatL Costis C
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: