Zabbix 2.4.3 API item.get gets the last value only if it's clock is between now - 24 hours

XMLWordPrintable

    • Type: Incident report
    • Resolution: Won't fix
    • Priority: Major
    • None
    • Affects Version/s: 2.4.3
    • Component/s: API (A)
    • None
    • Environment:
      OS: Debian 7.8 (Wheezy)
      SQL server: MariaDB 10.0.16

      I have this json request in PHP:
      ===

              $req_data = array('jsonrpc' => '2.0',
                                'method'  => 'item.get',
                                'auth'    => $auth_data,
                                'params'  => array(
                                    'groupids'    => [6, 7],
                                    'selectHosts' => 'extend',
                                    'output'      => 'extend',
                                    'search'      => array(
                                        'key_' => "outgoing_emails"
                                    ),
                                ),
                                'id'      => 2
              );
      

      ===
      This key is a Zabbix trapper of type text which gets data every 7 days through zabbix_sender. Zabbix API runs this query (from mysql general_log):
      ===
      SELECT * FROM history_text h WHERE h.itemid='207783' AND h.clock>1425309743 ORDER BY h.clock DESC LIMIT 2 OFFSET 0
      ===
      where clock 1425309743 (Mon Mar 2 16:22:23 CET 2015)
      is limited to the last 24 hours but the last value for this key was received on 27 Feb 2015, so as a result the API returns
      ===
      lastclock: 0
      lastvalue: 0
      ===

      The current values of this item are:
      ===
      select from_unixtime(clock), itemid, value from history_text where itemid=207783 order by clock desc;

      1. from_unixtime(clock), clock, itemid, value
        '2015-02-27 10:54:14', '1425030854', '207783', '20204 124986 248'
        '2015-02-23 11:06:03', '1424685963', '207783', '19924 123672 246'
        '2015-02-20 10:54:38', '1424426078', '207783', '19942 125017 245'
        '2015-02-16 22:41:44', '1424122904', '207783', '20296 127645 243'
        '2015-02-16 21:29:52', '1424118592', '207783', '20254 127166 243'
        '2015-02-13 10:55:09', '1423821309', '207783', '20154 122326 243'
        ===

            Assignee:
            Unassigned
            Reporter:
            Lucian Atody
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: