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

Trigger function doesn't accept user macro with multiplier

    XMLWordPrintable

Details

    • Incident report
    • Status: Closed
    • Trivial
    • Resolution: Won't fix
    • 4.0.10
    • None
    • Frontend (F)
    • None

    Description

      I have a template item which contains a certificate's expiration timestamp. To notice that it is about to expire I want to create a trigger using fuzzytime(). As time parameter I want to use a user macro containing the number of days before expiration. So I tried the following:

      {Template Certificate:client_cert.notafter_ts.fuzzytime({$CERT_MIN_VALID_DAYS}*86400)}=1
      

      Unfortunately the frontend doesn't accept this trigger expression and displays the following error message:

      Incorrect trigger function "fuzzytime({$CERT_MIN_VALID_DAYS}*86400)" provided in expression. Invalid first parameter.

      If I remove the multiplier the trigger expression is accepted.

      As macros can be used in arithmetic operations on a function's result I asume that this should also be possible for function parameters. In the documentation I couldn't find any notice, that user macros cannot be used this way.

      So I think this is either a bug in the frontend or the documenntation macros/trigger expresions should contain a notice that this isn't possible.

      As a workaround in my case I changed the macro value from "30" to "30d" which works as exprected. But this won't work for other trigger function or use cases.

      Attachments

        Activity

          People

            agavrilovs Aleksandrs Petrovs-Gavrilovs
            pu Pascal Uhlmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: