[ZBX-5637] Trigger expression helper (popup_trexpr.php) shows incorrect options Created: 2012 Oct 01  Updated: 2017 May 30  Resolved: 2012 Dec 10

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.3
Fix Version/s: 2.0.4rc1, 2.0.5rc1, 2.1.0

Type: Incident report Priority: Minor
Reporter: Oleksii Zagorskyi Assignee: Oleg Egorov (Inactive)
Resolution: Fixed Votes: 0
Labels: triggerconfigfilter, triggerconfigform, triggerfunctions
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Here is several improvements to make trigger expression constructor more consistent for different functions which have similar logic.

1. #count as a parameter for fuzzytime is allowed - but should be limited to seconds only.

  • 'Timestamp not different from Zabbix server time for more than T seconds, then N = 1, 0 - otherwise'

2. For regexp, iregexp - there only seconds available but #count should be as well.

  • 'Regular expression V matching last value in period T, then N = 1, 0 - otherwise'
  • 'Regular expression V matching last value in period T, then N = 1, 0 - otherwise (non case-sensitive)'

3. str function should have similar form design as for example regexp

  • 'Find string T in last (most recent) value. N = 1 - if found, 0 - otherwise'

Maybe other function should be checked as well



 Comments   
Comment by Toms (Inactive) [ 2012 Oct 05 ]

Oleksiy, please write according function descriptions (visible in Function dropdown in popup_trexpr.php) for given trigger functions (fuzzytime, for example).

What do you think about that in 2.0 along description function name would be visible in function dropdown "(abschange) Absolute difference between last and previous value < N" for example.

"trigger expression constructor" - I believe you meant "Trigger expression condition" window, as expression constructor is something different laying just below expression.

zalex_ua I'm not sure but I think it would be better to finish and merge ZBX-3204 and then return to this issue.
There are changes in similar sources, strings rewritten significantly, I'm afraid about conflicts (just my assumption).
Ok?

zalex_ua

  • New strings (as they will be after merging the ZBX-3204) added to issue description.
  • about writing description in the suggested way ("(abschange) Absolute ...") I don't have any objections but need to ask addition opinions.
  • yes, I meant the "Trigger expression condition" window, sorry for my own terms
Comment by Oleksii Zagorskyi [ 2012 Oct 06 ]

(4)
We should mention 3rd parameter in description for count function.

To make this correct the form should have additional field (O) for 3rd (operator) parameter.

Current description:
Number of successfully retrieved values V for period of time T > N

Suggested description:
Number of successfully retrieved values V (which fulfill operator O) for period of time T > N

And also add a field to put a Timeshift.
It's singe place where it missing since it supported there as 4th param.

oleg.egorov RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-5637 r31002

zalex_ua REOPENED
You forgot to update function description as I suggested.

Operator "O" we should be inserted in expression with double quotes around, as shown in documentation <- but first ask opinion of other devs.

The timeshift field is still missing. How it could be resolved ?

oleg.egorov RESOLVED

zalex_ua heh, works nice now, but I fount additional point which has to be implemented: 1st parameter supports sec or #num.
So need to change "Last of (T)" to the drop-down style to be able insert the count "#N" in expression.

oleg.egorov RESOLVED

zalex_ua Successfully tested. CLOSED

zalex_ua I wrote this comment during the ZBX-3204 development, so I originally used here not finished string (with unneeded "of time").
So in this development you actually have changed:
Number of successfully retrieved values V of a period T is > N
to
Number of successfully retrieved values V (which fulfill operator O) for period of time T > N
which is not very good (note added "of time").

Change these strings please to:
Number of successfully retrieved values V (which fulfill operator O) for period T > N

REOPENED

oleg.egorov RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-3204 r31172

zalex_ua checked, CLOSED

Comment by Oleksii Zagorskyi [ 2012 Oct 22 ]

(1) - successfully TESTED
(2) - why unneeded "timeshift" field as 3rd appeared and required "V" field as 1st disappeared ?
(3) - hey, updated "str" looks like old "regexp". But this is wrong - updated "str" should be like new "regexp", see (2) first ! Also please read function description - it there "T" variable used then corresponding field should use "T" label

oleg.egorov RESOLVED

zalex_ua
(2) why the label is "O" but not "V" as used in description ?
if use "count" in drop down and fill a value then a hash mark # will be inserted in expression before 1st parameter, but it should be before 2nd parameter. This is wrong such example: {:.iregexp(#reg,3)}=1

(3) Note that I just said above that there must be "T" label. This is still not fixed, still is "O". Btw, I suggest to use "V" label in function description and in field label.
Also the same problem with the hash mark #, as for (2)

REOPENED

oleg.egorov RESOLVED

zalex_ua Perfect ! CLOSED

Comment by Oleksii Zagorskyi [ 2012 Oct 24 ]

After using such a form (didn't used it before ) I have to say that here still are points which could be "polished" to be more "clear".
I mean more clear functions description and description for input fields but that's NOT a bug.
Probably will be improved once it the future.

I think now there no errors.
Ready to review by others devs.

Comment by Eduards Samersovs (Inactive) [ 2012 Oct 25 ]

Tested!

Comment by Oleg Egorov (Inactive) [ 2012 Oct 25 ]

FIXED IN 2.0.4rc1 r31072, 2.1.0(trunk) r31073
CLOSED

Comment by Alexander Vladishev [ 2012 Oct 26 ]

(4) Cannot add a trigger with str/regexp/iregexp functions without a second optional parameter.

Incorrect trigger function "regexp('aaa')" provided in expression. Mandatory parameter is missing. Check expression part starting from "

{Template OS Linux:system.hostname.regexp('aaa')}

#0".

zalex_ua Oleg created dev branch and has fixed this issue. I successfully tested.

Comment by Oleksii Zagorskyi [ 2012 Oct 28 ]

(5) take a look to ZBX-5754

oleg.egorov RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-5637 r31118

zalex_ua CLOSED

Comment by Eduards Samersovs (Inactive) [ 2012 Oct 29 ]

Tested!

Comment by Oleg Egorov (Inactive) [ 2012 Oct 29 ]

FIXED IN 2.0.4rc1 r31122, 2.1.0 r31123
CLOSED

Comment by Oleksii Zagorskyi [ 2012 Oct 31 ]

(6) for "last" function (Last (most recent) T value is < N) when we select "count" mode we have to be able put there a number but its input field is disabled

this is a REGRESSION from 2.0.3 !!!

REOPENED

oleg.egorovRESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-3204 r31161

zalex_ua tested, CLOSED

Comment by Oleksii Zagorskyi [ 2012 Oct 31 ]

(7) strlen should work identically to the "last", see just described in (6)
but currently when "Seconds" mode selected then its input field is allowed to be filled, but it should not.

this error came from 2.0.3

oleg.egorovRESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-3204 r31161

zalex_ua now in both cases the fields is not allowed to be filled, it's wrong.
So it as already done for last function.
See documentation http://www.zabbix.com/documentation/2.0/manual/appendix/triggers/functions
REOPENED

oleg.egorov RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-3204 r31172

zalex_ua successfully tested, CLOSED

Comment by Oleksii Zagorskyi [ 2012 Oct 31 ]

Ready to review by another dev.

Comment by Oleg Egorov (Inactive) [ 2012 Dec 10 ]

FIXED IN 2.0.5rc1 r31998, 2.1.0 r31999
CLOSED

Generated at Thu May 02 00:45:35 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.