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

zabbix_sender ignores HostnameItem if Hostname is not set

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • None
    • Agent (G)
    • Windows

      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.

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

              Created:
              Updated:
              Resolved: