[ZBX-2733] Zabbix timer process evaluate same item triggers per 30 sec even if a trigger including "nodata()" is disabled. Created: 2010 Jul 21  Updated: 2017 May 30  Resolved: 2010 Jul 22

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 1.8.2, 1.9.0 (alpha)
Fix Version/s: 1.8.3, 1.9.0 (alpha)

Type: Incident report Priority: Major
Reporter: Takanori Suzuki Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux, Zabbix server


Attachments: File trunk_r13332_FixTimerCheck.patch     PNG File zbx_01.png     PNG File zbx_02.png     PNG File zbx_03.png     PNG File zbx_04.png     PNG File zbx_05.png    

 Description   

Zabbix timer process evaluate same item triggers per 30 sec even if a trigger including "nodata()" is disabled.

I have following item and triggers.

  • "Host uptime(in sec)" item updated every 3000 sec (see zbx_05.png)
  • "nodata trigger" with "Normal + multiple PROBLEM events" (see zbx_04.png)
  • "error occurs with nodata trigger" with "Normal + multiple PROBLEM events" (see zbx_03.png)

I think only if "nodata trigger" is enabled, "nodata trigger" and "error occurs with nodata trigger" should be reported. (see zbx_01.png)
But, even if "nodata trigger" is disabled, "error occurs with nodata trigger" is still reported. (see zbx_02.png)

The following SQL in "process_time_functions()" executed by timer process dosen't check if triggers are enable or disable.

                                                                  1. in process_time_functions() ##############################################
                                                                    result = DBselect("select distinct %s,functions f where h.hostid=i.hostid and h.status=%d"
                                                                    " and i.status=%d and f.function in ('nodata','date','dayofweek','time','now')"
                                                                    " and i.itemid=f.itemid and (h.maintenance_status=%d or h.maintenance_type=%d)" DB_NODE,
                                                                    ZBX_SQL_ITEM_SELECT,
                                                                    HOST_STATUS_MONITORED,
                                                                    ITEM_STATUS_ACTIVE,
                                                                    HOST_MAINTENANCE_STATUS_OFF, MAINTENANCE_TYPE_NORMAL,
                                                                    DBnode_local("h.hostid"));
                                                                    #######################################################################################################

I think following is correct.

                                                                  1. in process_time_functions() ##############################################
                                                                    result = DBselect("select distinct %s,functions f, triggers t where h.hostid=i.hostid and h.status=%d"
                                                                    " and i.status=%d and f.triggerid=t.triggerid and t.status=%d and f.function in ('nodata','date','dayofweek','time','now')"
                                                                    " and i.itemid=f.itemid and (h.maintenance_status=%d or h.maintenance_type=%d)" DB_NODE,
                                                                    ZBX_SQL_ITEM_SELECT,
                                                                    HOST_STATUS_MONITORED,
                                                                    ITEM_STATUS_ACTIVE,
                                                                    TRIGGER_STATUS_ENABLED,
                                                                    HOST_MAINTENANCE_STATUS_OFF, MAINTENANCE_TYPE_NORMAL,
                                                                    DBnode_local("h.hostid"));
                                                                    #######################################################################################################


 Comments   
Comment by Takanori Suzuki [ 2010 Jul 21 ]

I checked this issue by trunk revision r13332.
I'll attach diff file for revision r13332.

Comment by Aleksandrs Saveljevs [ 2010 Jul 22 ]

Fixed in pre-1.8.3 in r13541.

Comment by Takanori Suzuki [ 2010 Jul 23 ]

Thank you Saveljevs.

I have a question.
The fix seems to evaluate only triggers which has 'nodata','date','dayofweek','time','now'.
Evaluating all triggers of same item was wrong behavior?
I've also feel it is little bit strange behavior.

Comment by Aleksandrs Saveljevs [ 2010 Jul 23 ]

Yes, the previous behavior was wrong. Normally, triggers are reevaluated only when new data for an item comes in. In your particular example, the trigger "system.uptime.last(0)>0" (zbx_03.png) should only be evaluated every 3000 seconds, which is the update interval of the "system.uptime" item (zbx_05.png). Only triggers containing time-driven functions like "nodata" should be reevaluated every 30 seconds.

Comment by Takanori Suzuki [ 2010 Jul 23 ]

Aha, I see.
Thank you Saveljevs.

Comment by Aleksandrs Saveljevs [ 2010 Jul 23 ]

Thank you for noticing it!

Generated at Fri Apr 26 00:26:08 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.