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

Script item: TEST does not work when using MACRO in parameters

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 7.0.0alpha7
    • Frontend (F)
    • None
    • Support backlog

      Similar problem as ZBX-21818{}

      Steps to reproduce:

      1. create host macro
      2. create Script item
      3. add param with value from example host macro
      4. add basic script (whatever you want)
        • var param=JSON.parse(value);
          return JSON.stringify(param);
      5. apply
      6. test
      7. get value and test
      8. return error
        • Cannot execute script: SyntaxError: invalid json (at offset 1) at [anon] (duktape.c:37568) internal at parse () native strict preventsyield at [anon] (function:1) preventsyield

      bug_script_item.mp4

      Result:
      The problem seems to be in passing the macro to the test script. When I save the item and press execute now, zabbix returns the correct value in latest data.

        1. bug_script_item.mp4
          2.87 MB
          Marek Rysavy
        2. image-2023-11-07-23-33-53-400.png
          47 kB
          Marek Rysavy

            zabbix.dev Zabbix Development Team
            marekrysavy Marek Rysavy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: