HTTP agent item - user macro set in "Required status codes" does not resolve

XMLWordPrintable

    • 2
    • 1

      Hello,

      according to documentation user macro is supported in field "Required status codes" for http agent item:
      https://www.zabbix.com/documentation/current/en/manual/appendix/macros/supported_by_location_user#items--item-prototypes
      https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/http#configuration

      But try configuring host with item like:

      zabbix_export:
        version: '7.4'
        host_groups:
          - uuid: 0104ac9d55974dd19990e6035d66baa3
            name: test
        hosts:
          - host: test-web
            name: test-web
            groups:
              - name: test
            items:
              - name: test
                type: HTTP_AGENT
                key: test.test
                delay: 1s
                value_type: TEXT
                url: 'https://zabbix.com'
                status_codes: '{$STATUS}'
            macros:
              - macro: '{$STATUS}'
                value: '200'
      

      And after it click test on item - in return this will be returned:

      Response code "200" did not match any of the required status codes "{$STATUS}"
      
      <!DOCTYPE html>
      <html lang='en'>
      <head>
      
      <meta charset="utf-8">
      
      <title>Zabbix: The enterprise-class open source observability solution</title>
      

      Expected: support what is stated in documentation,

            Assignee:
            Zabbix Development Team
            Reporter:
            Tomasz Grzechulski
            Team B
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 14h
                14h
                Remaining:
                Time Spent - 2h Remaining Estimate - 12h
                12h
                Logged:
                Time Spent - 2h Remaining Estimate - 12h
                2h