Ad Widget

Collapse

Zabbix Server 6.2.1 not updating trends

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rikrom
    Junior Member
    • May 2022
    • 3

    #1

    Zabbix Server 6.2.1 not updating trends

    Hello I've a Zabbix Server v.6.2.1 running on Ubuntu 20.04. The old data came from an older installation so a migration of the Maria DB has been done.

    Everything seems to works as expected except the trends data. Graphs are empty If I show data older than 2 days.

    As declared by the official documentation:

    Zabbix server accumulates trend data in runtime in the trend cache, as the data flows in. Server flushes previous hour trends of every item into the database (where frontend can find them) in these situations:
    • server receives the first current hour value of the item
    • 5 or less minutes of the current hour left and still no current hour values of the item
    • server stops

    To see trends on a graph you need to wait at least to the beginning of the next hour (if item is updated frequently) and at most to the end of the next hour (if item is updated rarely), which is 2 hours maximum.

    When server flushes trend cache and there are already trends in the database for this hour (for example, server has been restarted mid-hour), server needs to use update statements instead of simple inserts. Therefore on a bigger installation if restart is needed it is desirable to stop server in the end of one hour and start in the beginning of the next hour to avoid trend data overlap.

    History tables do not participate in trend generation in any way.
    I ran some checks on DB trends_uint table (both clock and itemid last ordered row);

    MariaDB [zabbix]> SELECT * From trends_uint order by itemid DESC LIMIT 1;
    +--------+------------+-----+-----------+-----------+-----------+
    | itemid | clock | num | value_min | value_avg | value_max |
    +--------+------------+-----+-----------+-----------+-----------+
    | 88516 | 1660723200 | 8 | 0 | 0 | 0 | -> Wednesday, August 17, 2022 10:00:00 AM GMT+02:00 DST
    +--------+------------+-----+-----------+-----------+-----------+
    1 row in set (0.002 sec)

    MariaDB [zabbix]> SELECT * From trends_uint order by clock DESC LIMIT 1;
    +--------+------------+-----+-----------+-----------+-----------+
    | itemid | clock | num | value_min | value_avg | value_max |
    +--------+------------+-----+-----------+-----------+-----------+
    | 23271 | 1660737600 | 2 | 0 | 0 | 0 | -> Wednesday, August 17, 2022 2:00:00 PM GMT+02:00 DST
    +--------+------------+-----+-----------+-----------+-----------+
    1 row in set (23.580 sec)


    Wednesday, August 17, 2022 was the time of lasts check of migrated data.

    I also have another freshly Zabbix Server 6.2.1 with no data migration. This one update trend tables as expected:

    MariaDB [zabbix]> SELECT * From trends_uint order by itemid DESC LIMIT 1;
    +--------+------------+-----+-----------+-----------+-----------+
    | itemid | clock | num | value_min | value_avg | value_max |
    +--------+------------+-----+-----------+-----------+-----------+
    | 39509 | 1662044400 | 3 | 1856 | 11730 | 24448 | -> Thursday, September 1, 2022 5:00:00 PM GMT+02:00 DST
    +--------+------------+-----+-----------+-----------+-----------+
    1 row in set (0.001 sec)

    MariaDB [zabbix]> SELECT * From trends_uint order by clock DESC LIMIT 1;
    +--------+------------+-----+-----------+-----------+-----------+
    | itemid | clock | num | value_min | value_avg | value_max |
    +--------+------------+-----+-----------+-----------+-----------+
    | 23271 | 1662530400 | 60 | 0 | 0 | 0 | -> Wednesday, September 7, 2022 8:00:00 AM GMT+02:00 DST
    +--------+------------+-----+-----------+-----------+-----------+
    1 row in set (1.037 sec)​



    What's wrong on the first Zabbix ? Which kind of debug can I do in order to solve the issue?

    Thanks in advance
  • rikrom
    Junior Member
    • May 2022
    • 3

    #2
    The trends came back forcing the override from Administration -> General -> Housekeeping -> Override item trend period

    Click image for larger version  Name:	override_item_trend_period.png Views:	0 Size:	10.7 KB ID:	451143

    But this override doesn't make sense. All the items already have the "Storage period" choosen:

    Click image for larger version  Name:	items_keep_trends.png Views:	0 Size:	9.7 KB ID:	451144


    UPDATE: Removing again the check in Administration -> General -> Housekeeping -> Override item trend period lets the trends being updated !!

    I think this may be a bug when migrating from old installation. Setting and then unsetting the general override solve the problem.
    Last edited by rikrom; 08-09-2022, 10:03.

    Comment


    • Vandoyn
      Vandoyn commented
      Editing a comment
      Thank you.
      I have the same problem and this help me too.
  • rvanderkooi
    Member
    • May 2019
    • 33

    #3
    Many thanks! i had the same problem and is solved now!

    Comment

    • defkev
      Junior Member
      • Dec 2022
      • 2

      #4
      Same problem after migrating a database from v4 to v6 including all post-upgrade steps (primary keys + double) on PostgreSQL​: Blank graphs for any period over "Last 2 days" on every item w/ Trend storage enabled.

      Looking at trends_uint the last update was around the time of the initial backup:

      Code:
      zabbix=> SELECT * From trends_uint order by clock DESC LIMIT 1;
      itemid | clock | num | value_min | value_avg | value_max
      --------+------------+-----+-----------+-----------+-----------
      26762 | 1669615200 | 1 | 100 | 100 | 100
      (1 row)​
      After enabling Trends Override in Housekeeping and waiting for the next full hour trend generation kicked in again:

      Code:
      zabbix=> SELECT * From trends_uint order by clock DESC LIMIT 1;
      itemid | clock | num | value_min | value_avg | value_max
      --------+------------+-----+-----------+-----------+-----------
      37320 | 1671328800 | 39 | 9798944 | 9800084 | 9801224
      (1 row)​
      This is probably something Zabbix should put in the upgrade documentation before people miss weeks of trends.

      Comment

      Working...