Zabbix: Fixing Active Checks to Work With Zabbix Proxy

We've recently changed our Zabbix 1.8.1 setup to include Zabbix Proxy, which broke all our active checks (f.ex. monitoring of log files). The solution seems to be having the proxy first, before the Zabbix Server, in the Zabbix Agent's config parameter Server, i.e. "Server=<proxy ip>,<server ip>".



After the introduction of the proxy, retrieval of active checks by the agent started to fail:


2977:20120803:142521.844 zabbix_agentd started. Zabbix 1.8.1 (revision 9702).
...
2984:20120803:142521.850 zabbix_agentd active check started [10.1.0.83:10051]
2984:20120803:142522.028 No active checks on server: host [myserver.example.com] not found


I know that this happens if the name of the host in the Zabbix Server UI differs from the Hostname in /etc/zabbix/zabbix_agentd.conf (myserver.example.com in this case) and indeed there was a difference - the name was shown as "my-zabbix-proxy.example.com:myserver.example.com" (my-zabbix-proxy.example.com is the hostname of the new Zabbix Proxy).

However it wasn't possible to change the name, when clicking on it (Configuration -> Hosts -> find the host -> click its name) to edit it, the proxy prefix there isn't editable. I tried to change Hostname in zabbix_agentd.conf to  "my-zabbix-proxy.example.com:myserver.example.com" but to no avail.

Finally I tried to switch the order of the server and proxy IPs in the Server param so that the proxy is first and thus the agent retrieves its active checks from the proxy instead of from the server, which fixed the problem.

From /var/log/zabbix-agent/zabbix_agentd.log after the change (and DebugLevel=4 as the default level of 3 only showed "active check started [10.2.0.150:10051]" followed by "collector started" but no details of the checks):


25382:20120808:145557.663 refresh_active_checks('10.2.0.150',10051)
25382:20120808:145557.664 Sending [{
  "request":"active checks",
  "host":"myserver.example.com"}]
25382:20120808:145557.664 Before read
25382:20120808:145557.669 Got [{
  "response":"success",
  "data":[
    {
      "key":"log[\"\/tmp\/ada\/hive.log\",\"ERROR\",,20]",
      "delay":"30",
      "lastlogsize":"284542",
      "mtime":"0"}]}]

Tags: monitoring DevOps


Copyright © 2024 Jakub Holý
Powered by Cryogen
Theme by KingMob