Zabbix frontend gets the oldest eventid in any cases using the next call:

      5. event->get [events.php:390]
      Parameters:
      Array
      (
          [source] => 0
          [object] => 0
          [output] => extend
          [objectids] => 
          [sortfield] => Array
              (
                  [0] => clock
              )
      
          [sortorder] => ASC
          [limit] => 1
      )
      Result:
      Array
      (
          [0] => Array
              (
                  [eventid] => 219
                  [source] => 0
                  [object] => 0
                  [objectid] => 13628
                  [clock] => 1401317490
                  [value] => 0
                  [acknowledged] => 0
                  [ns] => 365969275
              )
      
      )
      

      query looks like:

      • MySQL:
        SELECT e.* FROM events e WHERE EXISTS (SELECT NULL FROM functions f,items i,hosts_groups hgg JOIN rights r ON r.id=hgg.groupid AND r.groupid='7' WHERE e.objectid=f.triggerid AND f.itemid=i.itemid AND i.hostid=hgg.hostid GROUP BY f.triggerid HAVING MIN(r.permission)>0 AND MAX(r.permission)>=2) AND e.object='0' AND e.source='0' ORDER BY e.clock LIMIT 1 OFFSET 0
        
      • ORACLE:
        SELECT * FROM (SELECT   e.* FROM events e WHERE EXISTS (SELECT NULL FROM functions f,items i,hosts_groups hgg JOIN rights r ON r.id=hgg.groupid AND r.groupid=:"SYS_B_0" WHERE e.objectid=f.triggerid AND f.itemid=i.itemid AND i.hostid=hgg.hostid GROUP BY f.triggerid HAVING MIN(r.permission)>:"SYS_B_1" AND MAX(r.permission)>=:"SYS_B_2") AND e.object=:"SYS_B_3" AND e.source=:"SYS_B_4" ORDER BY e.clock) WHERE rownum BETWEEN :"SYS_B_5" AND :"SYS_B_6"
        

        In this case we need only min clock to build time line.

            Unassigned Unassigned
            dotneft Alexey Pustovalov
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: