See www.zabbix.com for the official Zabbix site.

Docs/howto/fqdn-windows

From Zabbix.org
Jump to: navigation, search

Here's a small and hackish Visual Basic script you can use as HostnameItem for your Windows agents. It returns the FQDN in lower case letters for systems with and without a domain.

Add the following to your agent configuration file:

  HostnameItem=system.run[cscript /nologo c:\zabbix\zabbix_fqdn.vbs]

File:Zabbix fqdn.sh -- Needless to say, the extension is rubbish. Please rename to .vbs!

Alternatively, you can use powershell to do this, with the added advantage of not needing an external script:

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

If you're going to use this "trick", you should be aware of the following bug: ZBXNEXT-1729 (zabbix_sender ignores HostnameItem if Hostname is not set)