[ZBX-10312] Cannot evaluate functions (str, regexp, iregexp) with sec parameter if there is no data in the period Created: 2016 Jan 27  Updated: 2017 May 30  Resolved: 2016 Apr 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.11
Fix Version/s: 2.2.13rc1, 3.0.3rc1, 3.2.0alpha1

Type: Incident report Priority: Blocker
Reporter: Kodai Terashima Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: evaluation, expressions, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 Description   

Trigger become unknown state when trigger expression has str and nodata function.

{host:itemkey.str(error,300)}=1&{host:itemkey.nodata(300)}#1

str(error,300) returns error if there is no history data in the period. It should return 0 (not found) in that case.



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Jan 27 ]

It reminds me about ZBXNEXT-1791 where discussion is for nodata() function for an unsupported item.
But core logic is the same - how we can return a value for a function if we don't have reliable basic data.

Comment by richlv [ 2016 Jan 27 ]

nodata() is a bit special case even for unsupported items, though - we have a reliable fact that there is no data

Comment by Oleksii Zagorskyi [ 2016 Jan 27 ]

Yeah, I agree with you, which means that the ZBXNEXT-1791 should be fixed first order, because it's more big evil

Comment by Kodai Terashima [ 2016 Jan 27 ]

This problem is not about nodata() function, str() is the cause of trigger evaluation error when nodata() works. I think ZBXNEXT-1791 is different issue.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Feb 26 ]

Is there an option of splitting one trigger in two with dependency between them?

Comment by Kodai Terashima [ 2016 Mar 01 ]

I confirmed that regexp() and iregexp() have same problem.

Comment by Oleksii Zagorskyi [ 2016 Mar 01 ]

CONFIRMED

Comment by Glebs Ivanovskis (Inactive) [ 2016 Mar 01 ]

Related issue ZBX-9913.

Comment by Andris Zeila [ 2016 Apr 11 ]

Also changed sum() function to return 0 if there are no data in the requested range.

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10312

Comment by Oleksii Zagorskyi [ 2016 Apr 11 ]

(1) I believe this change should be listed on upgrade notes.

wiper of course, what's new, upgrade notes and maybe also to supported trigger functions.

wiper Documented:

Note that in some places (for example 2.2 manual/introduction) the item order is messed up, probably because of different level top headers used in them. For example:

===== -#7 What's new in Zabbix 2.2.2 =====

and

==== - #2 What is Zabbix ====

sasha CLOSED

Comment by Sandis Neilands (Inactive) [ 2016 Apr 12 ]

Successfully tested.

To reproduce the expression must contain time function such as nodata() or two items - one for which there are values and another one for which there are no values. Trigger expressions are evaluated for the items that are being synchronized to DB or in timer process.

Other observations:

  • short-circuit logic operators would be useful in such case, e.g. "nodata(300)#1 && str(pattern,300)" would not evaluate str() if nodata() was true;
  • for other functions that can be used with time interval in seconds it is ambiguous what to do in case of no data (what is the maximum, minimum, average of 0 values?).
Comment by Andris Zeila [ 2016 Apr 20 ]

Released in:

  • pre-2.2.13rc1 r59547
  • pre-3.0.3rc1 r59548
  • pre-3.1.0 r59549
Generated at Fri Apr 26 04:03:47 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.