Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-12477

trigger.get selectLastEvent doesn't return latest event

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 3.2.7
    • Frontend (F)
    • None

      Hello, team.

      selectLastEvent, according to ZBX-11538, use MAX(clock) instead of MAX(eventid). I found myself very often in situations where instead of getting last eventid I get older one, in example below - OK event which somehow have clock with +1 second than next PROBLEM event.
      I couldn't rely on this mechanism and should build workaround via event.get. Event generation is complex to change - could selectLastEvent be switched to MAX(eventid) to return really latest event?

      ZAPI call:

      (calling zabbix api from Python for trigger.get with following parameters) {'triggerids': [4126491], 'output': [], 'selectLastEvent': []}
      (result is) [{'lastEvent': {'eventid': '128829412'}, 'triggerid': '4126491'}]
      

      SQL call:

      select * from events where objectid = 4126491 order by eventid desc limit 10;
      
      eventid	source	object	objectid	clock	value	acknowledged	ns
      128829419	0	0	4126491	1502095439	1	0	801713684
      128829412	0	0	4126491	1502095440	0	0	77449257
      128829352	0	0	4126491	1502095139	1	0	186444236
      128829350	0	0	4126491	1502095140	0	0	439473530
      128829248	0	0	4126491	1502094839	1	0	50480397
      128829242	0	0	4126491	1502094840	0	0	398694020
      128828881	0	0	4126491	1502094538	1	1	871799663
      128515730	0	0	4126491	1501101060	0	0	315420206
      128515550	0	0	4126491	1501100420	1	1	227990967
      128071553	0	0	4126491	1500378690	0	0	140366396
      

            Unassigned Unassigned
            Paskal Dmitry Verkhoturov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: