Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-1027

{TRIGGER.VALUE} cannot be used in trigger expression

    XMLWordPrintable

Details

    • Incident report
    • Resolution: Fixed
    • Major
    • None
    • 1.6.6
    • Frontend (F)
    • None
    • Zabbix 1.6.6

    Description

      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

      { error('An item key must be used in trigger expression'); return false; }

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

      { error('Unknown macro ['.$arr[ZBX_EXPRESSION_MACRO_ID].']'); return false; }

      }
      else if( !$arr[ZBX_EXPRESSION_MACRO_ID] ) {
      :

      Attachments

        Activity

          People

            Unassigned Unassigned
            xanco Aron Ujvari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: