Absolutely loving Zabbix so far but I've run into a little bit of a snag. My intention was to streamline Zabbix agent deployment to the mix of OS X and Linux machines I manage by executing a script to install the zabbix agent and generate the PSK via xCAT and then distribute zabbix_agentd.conf via Puppet. So far, it's worked perfectly except for one stubborn OS X machine. Here is the problem:
sh-3.2# scutil --get ComputerName
mac02
sh-3.2# scutil --get LocalHostName
mac02
sh-3.2# scutil --get HostName
mac02.example.com
sh-3.2# zabbix_get -s 127.0.0.1 -k "agent.hostname" --tls-connect=psk --tls-psk-identity="$(hostname -s)-PSK" --tls-psk-file=/Users/zabbix/zabbix_agentd.psk
localhost
My understanding is that, if there is no Hostname set in zabbix_agentd.conf, that the agent will present the system hostname to the Zabbix server when asking for active checks. This has been the case for every other machine except for mac02. As I'm mostly using active checks, this is a bit of a problem because the Zabbix server has no active checks defined for 'localhost'. It is easily solved by setting 'Hostname=mac02.example.com' but then I have to exclude the machine from my zabbix_agent puppet module.
Here is the output from one of the other OS X workstations.
sh-3.2# scutil --get HostName
mac01.example
sh-3.2# scutil --get LocalHostName
mac01
sh-3.2# scutil --get ComputerName
mac01
sh-3.2# zabbix_get -s 127.0.0.1 -k "agent.hostname" --tls-connect=psk --tls-psk-identity="$(hostname -s)-PSK" --tls-psk-file=/Users/zabbix/zabbix_agentd.psk
mac01.example.com
Both machines have exactly the same zabbix_agentd.conf file. Out of 20 OS X workstations and hundreds of Linux servers, this is the only one not behaving as expected. Does anyone have ideas?
Thanks,
Matt
sh-3.2# scutil --get ComputerName
mac02
sh-3.2# scutil --get LocalHostName
mac02
sh-3.2# scutil --get HostName
mac02.example.com
sh-3.2# zabbix_get -s 127.0.0.1 -k "agent.hostname" --tls-connect=psk --tls-psk-identity="$(hostname -s)-PSK" --tls-psk-file=/Users/zabbix/zabbix_agentd.psk
localhost
My understanding is that, if there is no Hostname set in zabbix_agentd.conf, that the agent will present the system hostname to the Zabbix server when asking for active checks. This has been the case for every other machine except for mac02. As I'm mostly using active checks, this is a bit of a problem because the Zabbix server has no active checks defined for 'localhost'. It is easily solved by setting 'Hostname=mac02.example.com' but then I have to exclude the machine from my zabbix_agent puppet module.
Here is the output from one of the other OS X workstations.
sh-3.2# scutil --get HostName
mac01.example
sh-3.2# scutil --get LocalHostName
mac01
sh-3.2# scutil --get ComputerName
mac01
sh-3.2# zabbix_get -s 127.0.0.1 -k "agent.hostname" --tls-connect=psk --tls-psk-identity="$(hostname -s)-PSK" --tls-psk-file=/Users/zabbix/zabbix_agentd.psk
mac01.example.com
Both machines have exactly the same zabbix_agentd.conf file. Out of 20 OS X workstations and hundreds of Linux servers, this is the only one not behaving as expected. Does anyone have ideas?
Thanks,
Matt
Comment