Ad Widget

Collapse

Zabbix Agent 2, 'PersistentBuffer' doesn't work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Antaiir
    Junior Member
    • Oct 2024
    • 1

    #1

    Zabbix Agent 2, 'PersistentBuffer' doesn't work

    Hi there,

    this seems broken for me (or lack of understanding on my end).

    I have the buffer on the agents enabled and set:

    Code:
    EnablePersistentBuffer=1
    PersistentBufferPeriod=15d
    PersistentBufferFile=/tmp/zabbix_BufferFile.sqlite
    All is working fine as long as the Zabbix-Server is online.

    When i take the server offline (it's just not a 24/7 running machine), the buffer file is created with rw permit for user 'zabbix', it contains only the IP address and hostname of the agent, but no other data are added. The file size also doesn't increase after the file is created.

    When the server is back online, there are no data for the agents for the offline duration of the server.

    Both, server and agent, are in the same network. Zabbix is 7.0 LTS, server is a headless Ubuntu-Server 24.04.1 LTS and agents are running either on the same OS version as the server or on a Debian 12.7.0.

    I have no idea, what i could have done wrong or what's causing this.


    Some info about my setup:

    Zabbix server 7.0 LTS is on a headless Ubuntu server 24.04.1 LTS in a ProxMox vm, running with MySQl and Nginx.

    One zabbix-agent2 is running 24/7 on a headless Debian 12.7.0 running on a Futro S520, same network as the server
    Another zabbix-agent2 is running on a headless Ubuntu server 24.04.1 LTS in a ProxMox vm, running in an external network.

    Both agents on different environment show identical behavior. I use passive mode in both cases.


    Steps to reproduce:

    - configure the agent for persistent buffering
    - stop the server for some minutes while the agents running
    - start the server after waiting some minutes
    - look at the monitoring data from that agents on the server
    - see the lack of agent data during the server offline duration


    What i expect to happen:

    No loss of monitoring data from running agents while the server is offline. I assume, the agents should transfer their stored data from the buffer file to the server as soon as the server is available again. In my understanding that's what persistent buffer means.


    What really happens:

    Loss of monitoring data from running agents while the server is offline, because there are no data buffered in the buffer file as expected, therefore no data are forwared to the server when it's available again.

    The buffer file is created but not filled with monitoring data.

    No additional log data is created for the agents when the server is offline.


    Any kind soul has an idea or two?

    Thanks in advance! :-)

    Antaiir
  • MolnarGabi
    Junior Member
    • Jul 2022
    • 2

    #2
    Hi Antaiir,

    I came to your post since I was testing the same functionality using the same method - but with a slightly different result. I am happy to share it, maybe it will help you to proceed. The results of mine: some of the data are collected even during server outage and some of them are not.
    Zabbix: 6.0.3
    OS: Centos 8.2

    Relevant agentconf:
    Code:
    EnablePersistentBuffer=1
    PersistentBufferPeriod=1h
    PersistentBufferFile=/tmp/zbx_agent.sql

    Also try to check the SQL file - like that to see whats going on - execute it multiple times:

    Code:
    sqlite> select * from data_1;
    73|1729521005|120785|-1|-1|-1|1||-1|-1|-1|1729521005|1768158
    74|1729521007|120787|-1|-1|-1|7594995712||-1|-1|-1|1729521007|1737419
    75|1729521008|120788|-1|-1|-1|92.744950||-1|-1|-1|1729521008|1727110​
    I was using the "Linux by Zabbix agent active​" template with an additional custom script with a 15s interval. Some of the metrics (like CPU usage, memory etc) were collected during outage, but not the custom item / script I created. I assumed it is because of the really small interval - so I decided to create the same item with a 1 min interval - and stopped the server for 2 mins. Even the custom item with 1min resolution was not collected - then decicded to reconfigure the userparamter to execute basic, but standard commands (like date +%s) and store these - same result.

    While only custom items with UserParameters are configured, the sqliteDB does not shows any data or submits data to the server when the connection is reestablished. While the connection is up the data is propagated well.
    Does anybody else experienced the same? It is only with custom items?

    Antaiir,
    What items did you checked on the server side - what items are monitored? Try using some builtin template for testing this functionality.

    Best regards,
    Gábor

    Comment

    • MolnarGabi
      Junior Member
      • Jul 2022
      • 2

      #3
      Update: please check that the items are configured as "Zabbix agent (active)" type, since these items are being covered by persistentbuffering. My issue was also resolved by configuring my custom item as Zabbix agent (active).

      Comment

      Working...