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

Upgrade patch doesn't quote macro + time suffix combination in aggregated function parameters

XMLWordPrintable

    • Sprint 76 (May 2021)
    • 0.25

      Problem description: Imagine that You're using zabbix 5.2 and have a host with an aggregated item that uses the macro + time suffix combination as the "Last of" parameter, for example:

       grpavg[\{$M},trap1,avg,\{$M3}s] 

      .
      After upgrading such configuration to the latest master such function is converted into the formula in following format, without quoting the macro + time suffix combination:

       avg(avg_foreach(/*/trap1?[group="\{$M}"],\{$M3}s)) 

      As result, if the user exports such configuration from master, he will not be able to import it anymore without inserting the quotes manually.

      Steps to reproduce:

      1. Open zabbix 5.2
      2. Import the following configuration: macro_with_suffix_aggregate.yaml
      3. upgrade database to the latest master (currently 5.4.0rc1)
      4. Open configuration of the "a9" item under hot "aggregate" and check "Formula" field
        Result 1: in the formula the macro + time suffix combination is not quoted.
      5. Export configuration of this host and attempt to import it.
        Result 2: it is not possible to import the host due to missing quotes:
         Invalid parameter "/1/params": incorrect expression starting from "avg(avg_foreach(/*/trap1?[group="\{$M}"],\{$M3}s))". 

      Expected: the macro + time suffix combination should be quoted during conversion when upgrading the database, for example:

       avg(avg_foreach(/*/trap1?[group="\{$M}"],"\{$M3}s")) 

      See screenshot....
      See attached patch file...

            wiper Andris Zeila
            solonkins Sergejs Olonkins
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: