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

Macro functions still don't work in item key parameters

XMLWordPrintable

    • DOC S25-W2/3
    • 2

      Steps to reproduce:

      1. Add macro {$ENDPOINT} with value https://example.com:8080 to Zabbix server
      2. Add item net.tcp.service[tcp,9.9.9.9,"\{{$ENDPOINT}.regsub(https://.+:(\d+)$,\\1)}"]

      Result:
      The item becomes unsupported, the frontend shows "Invalid third parameter."

      Logs:

      896202:20241224:145807.946 End substitute_simple_macros_impl() data:'{https://example.com:8080.regsub(https://.+:(\d+)$,\\1)}'
      896202:20241224:145807.946 End of substitute_key_macros_impl():SUCCEED data:'net.tcp.service[tcp,9.9.9.9,"{https://example.com:8080.regsub(https://.+:(\d+)$,\\1)}"]'
      896202:20241224:145807.946 In substitute_simple_macros_impl() data:EMPTY
      896202:20241224:145807.946 In substitute_simple_macros_impl() data:EMPTY
      896202:20241224:145807.946 In substitute_simple_macros_impl() data:'4s'
      896202:20241224:145807.946 End substitute_simple_macros_impl() data:'4s'
      896202:20241224:145807.946 End of zbx_prepare_items()
      896202:20241224:145807.946 In get_value() key:'net.tcp.service[tcp,9.9.9.9,"{{$ENDPOINT}.regsub(https://.+:(\d+)$,\\1)}"]'
      896202:20241224:145807.946 In get_value_simple() key_orig:'net.tcp.service[tcp,9.9.9.9,"{{$ENDPOINT}.regsub(https://.+:(\d+)$,\\1)}"]' addr:'127.0.0.1'
      896202:20241224:145807.946 End of get_value_simple():NOTSUPPORTED
      896202:20241224:145807.946 Item [Zabbix server:net.tcp.service[tcp,9.9.9.9,"{{$ENDPOINT}.regsub(https://.+:(\d+)$,\\1)}"]] error: Invalid third parameter.
      896202:20241224:145807.946 End of get_value():NOTSUPPORTED

      Expected:

      Proper macro substitution.

            martins-v Martins Valkovskis
            Kalimulin Alex Kalimulin
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 2h
                2h