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

log item not storing/updating "lastlogsize" if preprocessing is used causing logs to be re-read on agent restart

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.4
    • Agent (G)
    • None
    • Dockerized Zabbix using:
      zabbix/zabbix-server-pgsql:latest
      zabbix/zabbix-agent2:latest but tested also with zabbix/zabbix-agent:latest

      Steps to reproduce:

      1. Create a new item with:
        1. key: log["/var/lib/zabbix/test.log"]
        2. name: test log
        3. type: Zabbix agent (active)
        4. type of information: numeric (float)
        5. In the "Preprocessing" tab, add a preprocessing step, for example "left trim" with "a" as parameter
      2. Create and add a line to the test.log file, in this example we need to add a number as we set the information to numeric (float), for example: echo "2" >> /var/lib/zabbix/test.log
      3. Check that the "2" is shown in the latest data
      4. Restart the zabbix-agent
      5. Check that the "2" is collected again
      6. repeat as needed/wanted
      7. Check that item_rtdata for the created item shows "lastlogsize" = 0 and does not update even if other lines are added to the test.log file
      8. Edit the item, remove the preprocessing step (wait for config cache to be reloaded, zabbix agent to refresh the active items, ....)
      9. Check that now the "lastlogsize" is properly updated and restarting the agent doesn't cause the log file to be re-read and all the data sent again to the zabbix server

      I tested this behavior also using a fresh install using zabbix-server-pgsql docker image with "latest" tag, currently at time of writing 5.0.4.
      Also tested with both zabbix-agent2 and zabbix-agent images just for safety as preprocessing is done by server so this shouldn't be affected by the agent version.

      Any additional info please let me know
      thanks!

            neogan Andrei Gushchin (Inactive)
            gabriele.armao Gabriele Armao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: