Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-1729

zabbix_sender ignores HostnameItem if Hostname is not set

    XMLWordPrintable

    Details

    • Type: New Feature Request
    • Status: Closed
    • Priority: Trivial
    • Resolution: Won't fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Agent (G)
    • Environment:
      Windows

      Description

      In the agent configuration file, when leaving Hostname undefined (it's commented out), reads HostnameItem to determine the system's hostname. I took advantage of this situation in the following way:

      Configuration file snippet:

      # Hostname=Windows host
      HostnameItem=system.run[powershell -NonInteractive "[System.Net.Dns]::GetHostByName(($env:computerName)).Hostname.ToLower()"]
      

      This works OK for zabbix_agentd.exe, but does not work for zabbix_sender.exe:

      Program output:

      C:\Windows\system32>"%ProgramFiles%\zabbix_sender" -v -c %ProgramData%\Zabbix\Agent\zabbix_agentd.conf -k test -o "%Date% %Time%"
      zabbix_sender [4920]: Warning: 'Hostname' parameter required
      sent: 0; skipped: 1; total: 1
      

      Expected behaviour: zabbix_sender.exe falls back to HostnameItem if Hostname is undefined like zabbix_agentd.exe does.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              redshift Glenn Matthys
              Votes:
              9 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: