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

Windows Agent Metadata linebreak processing

XMLWordPrintable

    • Documentation backlog
    • 1

      Steps to reproduce:

      1. Create a script for metadata that output a multiline string (CLRF or LF does not seems to matter)
      2. Set it as a HostMetadataItem
      3. Set Agent debug to 4 (to have debug logs)
      4. Stop/Start the agent
      5. Look at the logs, you will see that the metadata are truncated at the first line, Change to remove the linebreaks, data is sent correctly.

      Result:

      Linebreak truncate the full output of metadata string.

       

      Log with linebreak

       4312:20250624:030739.444 execute_str() command:'powershell -File "C:\Program Files\Zabbix Agent\lib\metadata.ps1"' len:47 cmd_result:'031host=win-aerian'
       4312:20250624:030739.445 In connect_to_server() [10.5.0.30]:10051 [timeout:15, connection timeout:15]
       4312:20250624:030739.447 In is_ip4() ip:'10.5.0.30'
       4312:20250624:030739.448 End of is_ip4():SUCCEED
       4312:20250624:030739.449 sending [\{"request":"active checks","host":"WIN-3URONAUFGJ5-aerian","host_metadata":"031"}]
       4312:20250624:030739.450 before read 4312:20250624:030739.464 got [{"response":"success","data":[]}]

      Logs without

       5508:20250624:030627.553 execute_str() command:'powershell -File "C:\Program Files\Zabbix Agent\lib\metadata.ps1"' len:47 cmd_result:'031 host=win-aerian '
       5508:20250624:030627.554 In connect_to_server() [10.5.0.30]:10051 [timeout:15, connection timeout:15]
       5508:20250624:030627.556 In is_ip4() ip:'10.5.0.30'
       5508:20250624:030627.557 End of is_ip4():SUCCEED
       5508:20250624:030627.558 sending [\\{"request":"active checks","host":"WIN-3URONAUFGJ5-aerian","host_metadata":"031 host=win-aerian refapp=aerian templates=win"}]

      Expected:

      This should be managed as in Linux agent: Linebreak should not break the metadata.

            zabbix.dev Zabbix Development Team
            lince Mathieu M.
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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