ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10360

'fuzzytime' description on WEB UI differs from WEB's and is incorrect

    Details

      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.

        Activity

        Hide
        Oleksiy Zagorskyi added a comment -

        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.

        Show
        Oleksiy Zagorskyi added a comment - 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.
        Hide
        Oleksiy Zagorskyi added a comment -

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

        Unification code and documentation it's another point.

        Show
        Oleksiy Zagorskyi added a comment - Daiki, could you please confirm and describe that there indeed is a mistake ? Unification code and documentation it's another point.
        Hide
        MATSUDA Daiki added a comment -

        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.

        Show
        MATSUDA Daiki added a comment - 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.
        Hide
        Oleksiy Zagorskyi added a comment - - edited

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

        And, Martins Valkovskis, 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 Valkovskis 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."

        Oleksiy Zagorskyi 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)

        Show
        Oleksiy Zagorskyi added a comment - - edited We need attention from Kodai Terashima , please have a look to JA translations. And, Martins Valkovskis , 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 Valkovskis 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." Oleksiy Zagorskyi 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)
        Hide
        Kodai Terashima added a comment -

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

        Show
        Kodai Terashima added a comment - I fixed Japanese translation in 2.0. 2.2, 2,4 and 3.0.
        Hide
        Oleksiy Zagorskyi added a comment - - edited

        (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

        Gunars Pujats CLOSED

        Show
        Oleksiy Zagorskyi added a comment - - edited (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 Gunars Pujats CLOSED
        Hide
        Oleksiy Zagorskyi added a comment - - edited

        (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

        Gunars Pujats CLOSED

        Show
        Oleksiy Zagorskyi added a comment - - edited (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 Gunars Pujats CLOSED
        Hide
        richlv added a comment - - edited

        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

        Oleksiy Zagorskyi 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.

        Oleksiy Zagorskyi added, RESOLVED

        Gunars Pujats CLOSED

        Show
        richlv added a comment - - edited 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 Oleksiy Zagorskyi 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. Oleksiy Zagorskyi added, RESOLVED Gunars Pujats CLOSED
        Hide
        richlv added a comment - - edited

        (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.

        Oleksiy Zagorskyi Good point, replaced!
        RESOLVED

        Gunars Pujats CLOSED

        Show
        richlv added a comment - - edited (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. Oleksiy Zagorskyi Good point, replaced! RESOLVED Gunars Pujats CLOSED
        Hide
        Oleksiy Zagorskyi added a comment - - edited

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

        Show
        Oleksiy Zagorskyi added a comment - - edited Fixed in: pre-3.0.2rc1 r58882 pre-3.1.0 r58883
        Hide
        Oleksiy Zagorskyi added a comment - - edited

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

        Martins Valkovskis Looks good to me.

        Oleksiy Zagorskyi Thanks, replicated to 2.0, 2.2, 2.4, 3.2. CLOSED

        Show
        Oleksiy Zagorskyi added a comment - - edited Martins, please review related changes on https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions Martins Valkovskis Looks good to me. Oleksiy Zagorskyi Thanks, replicated to 2.0, 2.2, 2.4, 3.2. CLOSED

          People

          • Assignee:
            Unassigned
            Reporter:
            MATSUDA Daiki
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: