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

function last() is not expanded in map element labels and in graph names

    Details

    • Type: Incident report Incident report
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.3.0
    • Fix Version/s: 2.2.2rc1, 2.3.0
    • Component/s: Frontend (F)
    • Labels:

      Description

      If we use now write "last()" in this form then it would be good to add support for that also in map element labels and graph names.
      Function last() do not translates in map element labels and in graph names.

      I think documentation need improve about this: https://www.zabbix.com/documentation/2.2/manual/appendix/triggers/functions

        Issue Links

          Activity

          Hide
          Oleksiy Zagorskyi added a comment -

          Is this a feature request ?

          Also, the "translates" word here misleads me a bit. You probably meant sort of "expanded" ?

          Show
          Oleksiy Zagorskyi added a comment - Is this a feature request ? Also, the "translates" word here misleads me a bit. You probably meant sort of "expanded" ?
          Hide
          jabalv added a comment - - edited

          Not exactly a feature request. We now support trigger function last() without any parameters, but if we did such change, new function syntax should be supported in other front-end sections as well.

          Yes, maybe correct word would be "expand".

          Show
          jabalv added a comment - - edited Not exactly a feature request. We now support trigger function last() without any parameters, but if we did such change, new function syntax should be supported in other front-end sections as well. Yes, maybe correct word would be "expand".
          Hide
          richlv added a comment -

          yeah, looks like the change was not fully implemented in ZBX-6883... don't remember it was discussed, but there seem to be no comments about that

          Show
          richlv added a comment - yeah, looks like the change was not fully implemented in ZBX-6883 ... don't remember it was discussed, but there seem to be no comments about that
          Hide
          richlv added a comment - - edited

          probably worth checking all other places like notifications etc.

          also, why is map label validation/resolution different from other places in the frontend ?

          Alexander Vladishev In what "other places"?

          <richlv> first - various. second - trigger expression validation, for example

          Show
          richlv added a comment - - edited probably worth checking all other places like notifications etc. also, why is map label validation/resolution different from other places in the frontend ? Alexander Vladishev In what "other places"? <richlv> first - various. second - trigger expression validation, for example
          Hide
          Ivo Kurzemnieks added a comment -

          RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-7417

          Show
          Ivo Kurzemnieks added a comment - RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-7417
          Hide
          Alexander Vladishev added a comment - - edited

          (1) Zabbix shouldn't support KMGT suffixes in time-based parameters.

          Ivo Kurzemnieks RESOLVED in r40671

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (1) Zabbix shouldn't support KMGT suffixes in time-based parameters. Ivo Kurzemnieks RESOLVED in r40671 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (2) convertFunctionValue() function can emits E_NOTICE when processing empty $value and returns false instead of string.

          E_NOTICE can emits by this line:

          $suffix = $value[strlen($value) - 1];
          Uninitialized string offset: -1

          Ivo Kurzemnieks RESOLVED in r40671

          Alexander Vladishev REOPENED

          • the problem still reproducible in resolveGraphsFunctionalItemMacros() method
          • double call of convertFunctionValue() function when processing resolveMapLabelMacros() function
            • 1 - frontends/php/include/maps.inc.php:459
            • 2 - frontends/php/include/items.inc.php:1037

          Ivo Kurzemnieks RESOLVED in r40729

          Alexander Vladishev REOPENED

          • "===" operator should be used instead of "==" when compare two strings
          • check on empty parameter should be moved in getItemFunctionalValue() function
          • add there one more check 0 = $param ($param should be processed by convertFunctionValue() before this check)

          Ivo Kurzemnieks RESOLVED in r40738

          Alexander Vladishev CLOSED Please review my changes in r40753:40754 before a merge.

          Show
          Alexander Vladishev added a comment - - edited (2) convertFunctionValue() function can emits E_NOTICE when processing empty $value and returns false instead of string. E_NOTICE can emits by this line: $suffix = $value[strlen($value) - 1]; Uninitialized string offset: -1 Ivo Kurzemnieks RESOLVED in r40671 Alexander Vladishev REOPENED the problem still reproducible in resolveGraphsFunctionalItemMacros() method double call of convertFunctionValue() function when processing resolveMapLabelMacros() function 1 - frontends/php/include/maps.inc.php:459 2 - frontends/php/include/items.inc.php:1037 Ivo Kurzemnieks RESOLVED in r40729 Alexander Vladishev REOPENED "===" operator should be used instead of "==" when compare two strings check on empty parameter should be moved in getItemFunctionalValue() function add there one more check 0 = $param ($param should be processed by convertFunctionValue() before this check) Ivo Kurzemnieks RESOLVED in r40738 Alexander Vladishev CLOSED Please review my changes in r40753:40754 before a merge.
          Hide
          Alexander Vladishev added a comment - - edited

          (3) frontends/php/include/maps.inc.php:421 Line is too long

                  : '/{('.ZBX_PREG_HOST_FORMAT."|{HOSTNAME[0-9]?}|{HOST\.HOST[0-9]?}):.+\.(last|max|min|avg)\(([0-9]+[smhdwKMGT]?)?\)}/Uu"

          Ivo Kurzemnieks RESOLVED in r40671

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (3) frontends/php/include/maps.inc.php:421 Line is too long : '/{('.ZBX_PREG_HOST_FORMAT."|{HOSTNAME[0-9]?}|{HOST\.HOST[0-9]?}):.+\.(last|max|min|avg)\(([0-9]+[smhdwKMGT]?)?\)}/Uu" Ivo Kurzemnieks RESOLVED in r40671 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (4) please review my changes in r40732.

          Ivo Kurzemnieks REVIEWED.
          Thanks!
          CLOSED.

          Show
          Alexander Vladishev added a comment - - edited (4) please review my changes in r40732. Ivo Kurzemnieks REVIEWED. Thanks! CLOSED.
          Hide
          Ivo Kurzemnieks added a comment -

          Fixed in pre-2.2.2rc1 r40829 and pre-2.3.0 (trunk) r40831

          Show
          Ivo Kurzemnieks added a comment - Fixed in pre-2.2.2rc1 r40829 and pre-2.3.0 (trunk) r40831

            People

            • Assignee:
              Ivo Kurzemnieks
              Reporter:
              jabalv
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: