[ZBX-10360] 'fuzzytime' description on WEB UI differs from WEB's and is incorrect Created: 2016 Feb 08  Updated: 2017 May 30  Resolved: 2016 Mar 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.16, 2.2.11, 3.0.0rc1
Fix Version/s: 3.0.2rc1, 3.2.0alpha1

Type: Incident report Priority: Trivial
Reporter: MATSUDA Daiki Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: triggerfunctions
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The trigger function 'fuzzytime' description on WEB UI frontend differs from following WEB'S.
https://www.zabbix.com/documentation/2.2/manual/appendix/triggers/functions

And as I checked the source code, it is incorrect.

The following description shoud be change from 'more than' to 'less than and equal'
Timestamp not different from Zabbix server time for more than T seconds, then N = 1, 0 - otherwise
Timestamp not different from Zabbix server time for more than T seconds, then N NOT 1, 0 - otherwise

In addition, the other translations must be fixed.



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Feb 08 ]

Description for the "fuzzytime" function was always complicated for me to parse it
But I newer could say that it's working wrong or its description is wrong.

I recall a discussion and that description in documentation was improved, maybe in ZBX-3204.

Of course would be better that description in the helper and documentation are identical.

Comment by Oleksii Zagorskyi [ 2016 Feb 08 ]

Daiki, could you please confirm and describe that there indeed is a mistake ?

Unification code and documentation it's another point.

Comment by MATSUDA Daiki [ 2016 Feb 09 ]

As I read document and source code again, I have mistaken.
Simply, Japanese translation is incorrect in the file frontends/php/locale/ja/LC_MESSAGES/frontend.po for following 2 sentences.
13545 #: popup_trexpr.php:413
13546 msgid "Timestamp not different from Zabbix server time for more than T seconds, then N = 1 , 0 - otherwise"
13547 msgstr "タイムスタンプがZabbixサーバーの時刻とT秒以上の差がある場合 N = 1、その他の場合 N =0 (=条件)"
13548
13549 #: popup_trexpr.php:418
13550 msgid "Timestamp not different from Zabbix server time for more than T seconds, then N NOT 1, 0 - otherwise"
13551 msgstr "タイムスタンプがZabbixサーバーの時刻とT秒以上の差がある場合 N = 1、その他の場合 N =0 (#条件)"

In web manual and upper 2 line (l.13546 and l.13550) means that returns 1 when abs(local time - server time) <= N seconds. Is it correct?

But, in Japanese translation, it is against so returns 1 when abs(local time - server time) > N seconds.

Comment by Oleksii Zagorskyi [ 2016 Feb 09 ]

We need attention from kodai, please have a look to JA translations.

And, martins-v, how long time people will be crying reading so logically complicated sentences ?
I'd finally rewrite it ... by something like: Difference between A and B is more that C, then functions returns 0|1.

martins-v A different, but perhaps useful way of writing this could be:
"Returns 0 if difference between item timestamp value and Zabbix server timestamp is over T seconds; 1 - otherwise."

zalex_ua I've tested the function one more time to make sure we are correct at this stage, and we are!
The suggested description is ok for documentation, let's continue to resolve it in (2) sub issue.
But taking into account a style how trigger functions are described in the frontend helper, we need some different style. For frontend I suggest:
"Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N = 0, 1 - otherwise."
Will be resolved in (2)

Comment by Kodai Terashima [ 2016 Feb 09 ]

I fixed Japanese translation in 2.0. 2.2, 2,4 and 3.0.

Comment by Oleksii Zagorskyi [ 2016 Feb 26 ]

(1) [Documentation]
https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions
Updated the description, unified formatting, added an example.
Note - the example and its style is important to be like that, because this functions returns 0 for cases when it's usually considered to be a PROBLEM, while other functions (or even all) return 1 for usual PROBLEM case. So the example should help users to understand without doubts what they need to compare to in trigger expression.
RESOLVED

gunarspujats CLOSED

Comment by Oleksii Zagorskyi [ 2016 Feb 26 ]

(2)
Strings added:

  • Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N = 0, 1 - otherwise
  • Difference between item timestamp value and Zabbix server timestamp is over T seconds, then N NOT 0, 1 - otherwise

Strings deleted:

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

RESOLVED in r58739 and r58878

gunarspujats CLOSED

Comment by richlv [ 2016 Feb 29 ]

because this functions returns 0 for cases when it's usually considered to be a PROBLEM, while other functions (or even all) return 1 for usual PROBLEM case

Zalex, while 'usually' here helps, i just wanted to mention that reversing 0 and 1 is easy - for example, with the net.*.port items one might monitor a port that tends to be open, but should be closed.
even with fuzzytime(), one might get file modification time in an item, and check for that time not to be recent - if that's an error log file and we are not doing full log monitoring on it.

note that nothing to change here, just a minor clarification - and examples are always good

zalex_ua Hmm, indeed we could also mention key vfs.file.time[/path/file,modify]
In Examples we mention only functions, without possible items context, so reflecting logic =1 could be hard there and doesn't make much sense. Although, silly, but possible use case is vfs.file.time[/etc/passwd,modify].fuzzytime(3600)=1 - detect passwd file modification during last hour.
(4)
Suggested additional sentence (after "Usually ...") is:
Can be used also with vfs.file.time[/path/file,modify] key to check that file didn't get updates for long time.

zalex_ua added, RESOLVED

gunarspujats CLOSED

Comment by richlv [ 2016 Feb 29 ]

(3) note that the manual says for fuzzytime() :

Checking if system local time is in sync with Zabbix server time.

this can be misleading, as fuzzytime() can also be useful in other cases - for example, checking file modification times. something like the following suggested instead :

Checking how much an item timestamp value differs from the Zabbix server time.

zalex_ua Good point, replaced!
RESOLVED

gunarspujats CLOSED

Comment by Oleksii Zagorskyi [ 2016 Mar 08 ]

Fixed in:
pre-3.0.2rc1 r58882
pre-3.1.0 r58883

Comment by Oleksii Zagorskyi [ 2016 Mar 08 ]

Martins, please review related changes on https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions

martins-v Looks good to me.

zalex_ua Thanks, replicated to 2.0, 2.2, 2.4, 3.2. CLOSED

Generated at Fri Mar 29 04:16:55 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.