[ZBX-12121] "Nodata" triggers doesn't work Created: 2017 Apr 28  Updated: 2024 Apr 10  Resolved: 2017 May 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.5
Fix Version/s: 3.2.6rc1, 3.4.0alpha1

Type: Incident report Priority: Blocker
Reporter: Alexander Ivanes Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 4.4.0-36-generic #55~14.04.1-Ubuntu x86_64 GNU/Linux


Attachments: File ZBX-12121.patch    
Issue Links:
Duplicate
is duplicated by ZBX-12124 Zabbix nodata() function stopped working Closed
is duplicated by ZBX-12143 time() expression in triggers not wor... Closed
is duplicated by ZBX-12184 NODATA triggers not working Closed
is duplicated by ZBX-12126 trigget nodata dont work Closed
Team: Team C
Sprint: Sprint 7
Story Points: 1

 Description   

After upgrading server from 3.0 to 3.2.5 i discovered that triggers, that uses nodata() function, doesn't fired up when they should do so. (Simple example is a standard {Template App Zabbix Agent:agent.ping.nodata(5m)}=1 expression).

Also i checked all previous versions (3.2.0 - 3.2.4) and they are not affected by this.

Forum post that i think related to this issue: https://www.zabbix.com/forum/showthread.php?t=57767

Regards,
Alexander Ivanes



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2017 Apr 28 ]

Piece of debug log from current trunk:

 15788:20170428:182429.542 __zbx_zbx_setproctitle() title:'timer #1 [processed 1 triggers, 0 events in 0.000780 sec, 0 maintenances in 0.002440 sec, processing time functions]'
 15788:20170428:182429.542 In process_time_functions()
 15788:20170428:182429.542 In evaluate_expressions() tr_num:1
 15788:20170428:182429.542 In substitute_simple_macros() data:'{12900}=1'
 15788:20170428:182429.542 End substitute_simple_macros() data:'{12900}=1'
 15788:20170428:182429.542 In substitute_functions()
 15788:20170428:182429.542 In zbx_extract_functionids() tr_num:1
 15788:20170428:182429.542 End of zbx_extract_functionids() functionids_num:1
 15788:20170428:182429.542 In zbx_populate_function_items() functionids_num:1
 15788:20170428:182429.542 End of zbx_populate_function_items() ifuncs_num:1
 15788:20170428:182429.543 In zbx_evaluate_item_functions() funcs_num:1
 15788:20170428:182429.543 In evaluate_function() function:'Zabbix server:agent.ping.nodata(5m)'
 15788:20170428:182429.543 In evaluate_NODATA()
 15788:20170428:182429.543 In get_function_parameter_int() parameters:'5m' Nparam:1
 15788:20170428:182429.543 In substitute_simple_macros() data:'5m'
 15788:20170428:182429.543 get_function_parameter_int() type:sec value:300
 15788:20170428:182429.543 End of get_function_parameter_int():SUCCEED
 15788:20170428:182429.543 In zbx_vc_get_value_range() itemid:23287 value_type:3 seconds:300 count:1 timestamp:1493393069
 15788:20170428:182429.543 End of zbx_vc_get_value_range():SUCCEED count:0 cached:1
 15788:20170428:182429.543 End of evaluate_NODATA():SUCCEED
 15788:20170428:182429.543 End of evaluate_function():SUCCEED value:'1'
 15788:20170428:182429.543 End of zbx_evaluate_item_functions()
 15788:20170428:182429.543 In zbx_substitute_functions_results() ifuncs_num:1 tr_num:1
 15788:20170428:182429.543 zbx_substitute_functions_results() expression[0]:'{12900}=1' => '1=1'
 15788:20170428:182429.543 End of zbx_substitute_functions_results()
 15788:20170428:182429.543 End of substitute_functions()
 15788:20170428:182429.543 In evaluate() expression:'1=1'
 15788:20170428:182429.543 End of evaluate() value:1.000000
 15788:20170428:182429.543 End of evaluate_expressions()
 15788:20170428:182429.543 query [txnlev:1] [begin;]
 15788:20170428:182429.544 In zbx_process_triggers() values_num:1
 15788:20170428:182429.544 In zbx_process_trigger() triggerid:13491 value:0(0) new_value:3
 15788:20170428:182429.544 End of zbx_process_trigger():FAIL flags:0
 15788:20170428:182429.544 End of zbx_process_triggers()
 15788:20170428:182429.544 In process_trigger_events() events_num:0
 15788:20170428:182429.544 End of process_trigger_events() processed:0
 15788:20170428:182429.544 query [txnlev:1] [commit;]
 15788:20170428:182429.544 End of process_time_functions()
 15788:20170428:182429.544 In flush_correlated_events() events_num:0
 15788:20170428:182429.544 End of flush_correlated_events() events_num:0
 15788:20170428:182429.544 __zbx_zbx_setproctitle() title:'timer #1 [processed 1 triggers, 0 events in 0.001982 sec, 0 maintenances in 0.000000 sec, idle 1 sec]'

new_value:3 is TRIGGER_VALUE_NONE. Looks like regression from ZBX-11829:

@@ -4372,7 +4501,11 @@
 		/* trigger expression evaluates to true, set PROBLEM value */
 		if (SUCCEED != zbx_double_compare(expr_result, 0.0))
 		{
-			tr->new_value = TRIGGER_VALUE_PROBLEM;
+			if (ZBX_DC_TRIGGER_BASE_EXPRESSION == tr->flags)
+				tr->new_value = TRIGGER_VALUE_PROBLEM;
+			else
+				tr->new_value = TRIGGER_VALUE_NONE;
+
 			continue;
 		}
Comment by Glebs Ivanovskis (Inactive) [ 2017 Apr 28 ]

Timer process does not call zbx_determine_items_in_expressions() before zbx_process_triggers() like history syncer does in DCmass_update_triggers(). Therefore triggers processed by timer processes do not have ZBX_DC_TRIGGER_BASE_EXPRESSION properly set and end up with all trigger new values being TRIGGER_VALUE_NONE which cannot change the value of the trigger in the database.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Apr 28 ]

Fix for version 3.2 is available in development branch svn://svn.zabbix.com/branches/dev/ZBX-12121 revision 67684.

Patch for 3.2 attached: ZBX-12121.patch

Comment by Sergejs Paskevics [ 2017 May 02 ]

Successfully tested. Please check my minor changes r67705.

glebs.ivanovskis Step in right direction. Please review my minor adjustments in r67735. And please fix comment for your function zbx_determine_items_in_expressions(), I don't think it does what the comment says.

s.paskevics Looks good. Please check my comment for function zbx_determine_items_in_expressions() in r67741.

glebs.ivanovskis Thank you!

Comment by Glebs Ivanovskis (Inactive) [ 2017 May 02 ]

Fixed in pre-3.2.6.rc1 r67745, pre-3.4.0alpha1 (trunk) r67746.

Comment by Johan Romijn [ 2017 May 18 ]

Like reported in ZBX-12184 I also still have the problem with the trigger not working for agent.ping.nodata with Zabbix 3.2.6

Comment by Glebs Ivanovskis (Inactive) [ 2017 May 18 ]

I just wanted to say that faulty nodata() triggers will not fire immediately after you start upgraded Zabbix server, you will need to wait the amount of time specified in nodata() parameter. That's how it works, nodata() is inactive some time after server restart.

Comment by Johan Romijn [ 2017 May 18 ]

My Zabbix server it up for 18 days, I upgraded to 3.2.6 a couple of days ago.
However this trigger

{Template App Zabbix Agent:agent.ping.nodata(3m)}=1

doesn't alert when server is down or agent is unreachable.

To work around this I created this item; net.tcp.service[tcp,,10050]

Comment by Alexander Ivanes [ 2017 May 18 ]

Works fine for me in 3.2.6.

Comment by Johan Romijn [ 2017 May 18 ]

Isn't this what's causing the problem?

  1561:20170518:183718.890 Zabbix agent item "agent.ping" on host "SERVER1" failed: first network error, wait for 15 seconds
  1585:20170518:183733.463 Zabbix agent item "agent.ping" on host "SERVER1" failed: another network error, wait for 15 seconds
  1583:20170518:183748.752 Zabbix agent item "agent.ping" on host "SERVER1" failed: another network error, wait for 15 seconds
  1574:20170518:183803.374 temporarily disabling Zabbix agent checks on host "SERVER1": host unavailable
Comment by Glebs Ivanovskis (Inactive) [ 2017 May 18 ]

Dear J0HAN85, I suggest your configuration. Is trigger enabled? Is item enabled and supported? Is host enabled and not in maintenance? Is action configured accordingly? And so on. These are general Zabbix questions, feel free to use these ways of getting help.

Comment by Glebs Ivanovskis (Inactive) [ 2017 May 18 ]

No, these errors shouldn't interfere with nodata().

Comment by Johan Romijn [ 2017 May 24 ]

Rebooted Zabbix server today, suddenly agent.ping.nodata trigger works again.

Comment by Glebs Ivanovskis (Inactive) [ 2017 May 24 ]

Nice to hear! Probably old version was still running.

Generated at Sat Apr 26 06:00:06 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.