[ZBX-7417] function last() is not expanded in map element labels and in graph names Created: 2013 Nov 20  Updated: 2017 May 30  Resolved: 2013 Dec 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.0, 2.3.0
Fix Version/s: 2.2.2rc1, 2.3.0

Type: Incident report Priority: Critical
Reporter: jabalv Assignee: Ivo Kurzemnieks
Resolution: Fixed Votes: 0
Labels: maplabels
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-7710 not resolving {host:key.func(param)} ... Closed

 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



 Comments   
Comment by Oleksii Zagorskyi [ 2013 Nov 21 ]

Is this a feature request ?

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

Comment by jabalv [ 2013 Nov 21 ]

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

Comment by richlv [ 2013 Nov 21 ]

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

Comment by richlv [ 2013 Nov 21 ]

probably worth checking all other places like notifications etc.

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

sasha In what "other places"?

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

Comment by Ivo Kurzemnieks [ 2013 Nov 28 ]

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

Comment by Alexander Vladishev [ 2013 Nov 29 ]

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

iivs RESOLVED in r40671

sasha CLOSED

Comment by Alexander Vladishev [ 2013 Nov 29 ]

(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

iivs RESOLVED in r40671

sasha 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

iivs RESOLVED in r40729

sasha 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)

iivs RESOLVED in r40738

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

Comment by Alexander Vladishev [ 2013 Nov 29 ]

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

iivs RESOLVED in r40671

sasha CLOSED

Comment by Alexander Vladishev [ 2013 Dec 04 ]

(4) please review my changes in r40732.

iivs REVIEWED.
Thanks!
CLOSED.

Comment by Ivo Kurzemnieks [ 2013 Dec 09 ]

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

Generated at Sat Apr 27 01:37:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.