I'm bootstrapping a fresh zabbix 3 installation on a dev box.
I've enabled discovery rule for 192.168.1.x setting Device uniqueness criteria
to system.uname (also tried with system.hostname). Checks
are defined appropriately (e.g. Zabbix agent "system.uname"
).
Also, I've activated the built-in action to assign Linux machines to appropriate host group.
Zabbix server manages do discover a second dev machine configured as zabbix client, but uses the IP instead of hostname for host's Host name
attribute.
This is inconvenient. So how to configure zabbix to display hostname (or even better fqdn) instead of IP for discovered hosts?
Current client configuration looks like:
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogType=file
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=100
DebugLevel=3
EnableRemoteCommands=1
LogRemoteCommands=0
Server=192.168.1.21
ListenPort=10050
ListenIP=192.168.1.11
StartAgents=3
HostnameItem=system.hostname
RefreshActiveChecks=120
BufferSend=5
BufferSize=100
MaxLinesPerSecond=100
Timeout=3
AllowRoot=0
Include=/etc/zabbix/zabbix_agentd.d
UnsafeUserParameters=0
LoadModulePath=/usr/lib/modules
I've already tried to set Hostname=system.hostname
instead of HostnameItem
and HostnameItem=system.run[hostname]
, but this didn't seem to work.
How to solve this?
Best Answer
You have to set your reverse DNS with correct PTR record AND set up hostname in zabbix_agentd.conf