ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7573

item with flexible interval checked at a wrong time

    Details

      Description

      I have two items scheduled to be checked once a week on Mondays:

      • Item A should be checked early morning using interval "60" + "1,03:45-03:46".
      • Item B should be checked during the day using interval "60" + "1,12:45-12:46".

      However, both of these items were checked today in the morning (on Saturday). Here is the list of last checked times for these two items:

      • Item A:

      2013.Dec.21 08:25:06 No (0)
      2013.Dec.16 03:45:06 Yes (1)
      2013.Dec.09 03:45:06 Yes (1)

      • Item B:

      2013.Dec.21 08:25:07 No (0)
      2013.Dec.16 12:45:07 Yes (1)
      2013.Dec.09 12:45:07 Yes (1)

        Activity

        Hide
        Aleksandrs Saveljevs added a comment -
        mysql> select itemid, from_unixtime(clock), clock, ns, value from history_uint where itemid=23106 order by clock desc;
        +--------+----------------------+------------+-----------+-------+
        | itemid | from_unixtime(clock) | clock      | ns        | value |
        +--------+----------------------+------------+-----------+-------+
        |  23106 | 2013-12-21 08:25:06  | 1387607106 | 591003940 |     0 |
        |  23106 | 2013-12-16 03:45:06  | 1387158306 | 914034405 |     1 |
        |  23106 | 2013-12-09 03:45:06  | 1386553506 | 493183023 |     1 |
        +--------+----------------------+------------+-----------+-------+
        
        mysql> select itemid, from_unixtime(clock), clock, ns, value from history_uint where itemid=23107 order by clock desc;
        +--------+----------------------+------------+-----------+-------+
        | itemid | from_unixtime(clock) | clock      | ns        | value |
        +--------+----------------------+------------+-----------+-------+
        |  23107 | 2013-12-21 08:25:07  | 1387607107 | 597804269 |     0 |
        |  23107 | 2013-12-16 12:45:07  | 1387190707 |  53387764 |     1 |
        |  23107 | 2013-12-09 12:45:07  | 1386585907 | 423022265 |     1 |
        +--------+----------------------+------------+-----------+-------+
        
        Show
        Aleksandrs Saveljevs added a comment - mysql> select itemid, from_unixtime(clock), clock, ns, value from history_uint where itemid=23106 order by clock desc; +--------+----------------------+------------+-----------+-------+ | itemid | from_unixtime(clock) | clock | ns | value | +--------+----------------------+------------+-----------+-------+ | 23106 | 2013-12-21 08:25:06 | 1387607106 | 591003940 | 0 | | 23106 | 2013-12-16 03:45:06 | 1387158306 | 914034405 | 1 | | 23106 | 2013-12-09 03:45:06 | 1386553506 | 493183023 | 1 | +--------+----------------------+------------+-----------+-------+ mysql> select itemid, from_unixtime(clock), clock, ns, value from history_uint where itemid=23107 order by clock desc; +--------+----------------------+------------+-----------+-------+ | itemid | from_unixtime(clock) | clock | ns | value | +--------+----------------------+------------+-----------+-------+ | 23107 | 2013-12-21 08:25:07 | 1387607107 | 597804269 | 0 | | 23107 | 2013-12-16 12:45:07 | 1387190707 | 53387764 | 1 | | 23107 | 2013-12-09 12:45:07 | 1386585907 | 423022265 | 1 | +--------+----------------------+------------+-----------+-------+
        Hide
        Strahinja Kustudic added a comment - - edited

        I also had the same problem with one item which is in a template used on 230 servers. The item's flexible interval is "2000" + 1-7,08:00-09:00 and today it executed when it was supposed to, but it also executed from one hour to a few hours later depending on a server. Here are the last 4 executions on a few servers:

        server-001:
        12/21/2013 10:04:05 AM
        12/21/2013 08:57:25 AM
        12/21/2013 08:24:05 AM
        12/20/2013 08:30:45 AM

        server-100:
        12/21/2013 10:04:34 AM
        12/21/2013 08:57:54 AM
        12/21/2013 08:24:34 AM
        12/20/2013 08:31:14 AM

        server-150:
        12/21/2013 12:26:24 PM
        12/21/2013 08:33:04 AM
        12/20/2013 08:39:44 AM
        12/20/2013 08:06:24 AM

        server-224:
        12/21/2013 04:14:25 PM
        12/21/2013 08:27:45 AM
        12/20/2013 08:34:25 AM
        12/20/2013 08:01:05 AM

        Also I'm running Zabbix 2.0.6, so this probably isn't an issue just with the latest version. I also find this very odd that it had happened to me as well as the issue creator on the same day. It must be some strange bug with Zabbix and today's date.

        Show
        Strahinja Kustudic added a comment - - edited I also had the same problem with one item which is in a template used on 230 servers. The item's flexible interval is "2000" + 1-7,08:00-09:00 and today it executed when it was supposed to, but it also executed from one hour to a few hours later depending on a server. Here are the last 4 executions on a few servers: server-001: 12/21/2013 10:04:05 AM 12/21/2013 08:57:25 AM 12/21/2013 08:24:05 AM 12/20/2013 08:30:45 AM server-100: 12/21/2013 10:04:34 AM 12/21/2013 08:57:54 AM 12/21/2013 08:24:34 AM 12/20/2013 08:31:14 AM server-150: 12/21/2013 12:26:24 PM 12/21/2013 08:33:04 AM 12/20/2013 08:39:44 AM 12/20/2013 08:06:24 AM server-224: 12/21/2013 04:14:25 PM 12/21/2013 08:27:45 AM 12/20/2013 08:34:25 AM 12/20/2013 08:01:05 AM Also I'm running Zabbix 2.0.6, so this probably isn't an issue just with the latest version. I also find this very odd that it had happened to me as well as the issue creator on the same day. It must be some strange bug with Zabbix and today's date.
        Hide
        richlv added a comment -

        for the record, we changed how flexible interval calculation worked in ZBX-4852

        Show
        richlv added a comment - for the record, we changed how flexible interval calculation worked in ZBX-4852
        Hide
        Aleksandrs Saveljevs added a comment -
        Show
        Aleksandrs Saveljevs added a comment - It is interesting to note that December 21, 08:25:06 is also mentioned in the above issue at https://support.zabbix.com/browse/ZBX-4852?focusedCommentId=58308&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-58308 .
        Hide
        Aleksandrs Saveljevs added a comment -

        Let me describe the problem briefly. There is a function calculate_item_nextcheck() and the comment used to say the following: "if item check is forbidden with delay=0 (default and flexible), a timestamp approximately one year in the future is returned". That, however, was not true. The value actually returned was nextcheck calculated as if item's update interval was set to once a year, which could as well happen in the near future, and this was the case on December 21.

        I have changed this function in two ways. First of all, instead of using SEC_PER_YEAR to signify that an item should not be checked, we now use 0, same as "delay" value in the database. Second, if item should not be checked, this function now returns a timestamp for January 1, 2038.

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7573 .

        Show
        Aleksandrs Saveljevs added a comment - Let me describe the problem briefly. There is a function calculate_item_nextcheck() and the comment used to say the following: "if item check is forbidden with delay=0 (default and flexible), a timestamp approximately one year in the future is returned". That, however, was not true. The value actually returned was nextcheck calculated as if item's update interval was set to once a year, which could as well happen in the near future, and this was the case on December 21. I have changed this function in two ways. First of all, instead of using SEC_PER_YEAR to signify that an item should not be checked, we now use 0, same as "delay" value in the database. Second, if item should not be checked, this function now returns a timestamp for January 1, 2038. Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7573 .
        Hide
        Aleksandrs Saveljevs added a comment -

        Reopening, because the changes were only done on the server side. Frontend side should be fixed, too.

        Show
        Aleksandrs Saveljevs added a comment - Reopening, because the changes were only done on the server side. Frontend side should be fixed, too.
        Hide
        Aleksandrs Saveljevs added a comment -

        Frontend side fixed. Development branch svn://svn.zabbix.com/branches/dev/ZBX-7573 available for review.

        Show
        Aleksandrs Saveljevs added a comment - Frontend side fixed. Development branch svn://svn.zabbix.com/branches/dev/ZBX-7573 available for review.
        Hide
        Aleksandrs Saveljevs added a comment - - edited

        There were conflicts when merging from 2.0 into 2.2, so I have merged the changes in a separate development branch. URL is the same: svn://svn.zabbix.com/branches/dev/ZBX-7573 .

        Alexander Vladishev Successfully tested! CLOSED

        Show
        Aleksandrs Saveljevs added a comment - - edited There were conflicts when merging from 2.0 into 2.2, so I have merged the changes in a separate development branch. URL is the same: svn://svn.zabbix.com/branches/dev/ZBX-7573 . Alexander Vladishev Successfully tested! CLOSED
        Hide
        Aleksandrs Saveljevs added a comment -

        Fixed in pre-2.0.11 r41324, pre-2.2.2 r41373, and pre-2.3.0 (trunk) r41374.

        Show
        Aleksandrs Saveljevs added a comment - Fixed in pre-2.0.11 r41324, pre-2.2.2 r41373, and pre-2.3.0 (trunk) r41374.

          People

          • Assignee:
            Unassigned
            Reporter:
            Aleksandrs Saveljevs
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: