-
Incident report
-
Resolution: Fixed
-
Major
-
None
-
1.6.6
-
None
-
Zabbix 1.6.6
When I try to create a hysteresis trigger I get the following error message: "An item key must be used in trigger expression"
I have traced down the problem and I found that in version 1.6.6 there is a new piece of code in include/triggers.inc.php starting from line 716:
if($arr[ZBX_EXPRESSION_MACRO_ID] && !isset($ZBX_TR_EXPR_ALLOWED_MACROS[$arr[ZBX_EXPRESSION_MACRO_ID]]) )
{ error('Unknown macro ['.$arr[ZBX_EXPRESSION_MACRO_ID].']'); return false; }else if( !$arr[ZBX_EXPRESSION_MACRO_ID] )
{ ... }// line 716:
else
Since the first two "if" expression does not allow the usage of
{TRIGGER.VALUE}macro it goes always to this "else" branch, that gives an error.
I think the first "if" expression should be splitted into two to like this to allow valid macros to be used and only deny the not allowed macros:
if($arr[ZBX_EXPRESSION_MACRO_ID]) {
if (!isset($ZBX_TR_EXPR_ALLOWED_MACROS[$arr[ZBX_EXPRESSION_MACRO_ID]]) )
}
else if( !$arr[ZBX_EXPRESSION_MACRO_ID] ) {
: