3

Zabbix: Fixing Active Checks to Work With Zabbix Proxy

 2 years ago
source link: https://blog.jakubholy.net/2012/08/08/zabbix-fixing-active-checks-to-work-with-zabbix-proxy/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Zabbix: Fixing Active Checks to Work With Zabbix Proxy

August 8, 2012
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"}]}]

Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.

Allow me to write to you!

Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK