Skip to content

Configure Zabbix Agent on the Zabbix Proxy

Video Lecture

Configure Zabbix Agent on the Zabbix Proxy Configure Zabbix Agent on the Zabbix Proxy

Description

The correct Zabbix repository was already installed from the last section, so we can just run,

#
apt install zabbix-agent

Note

Remember that if you are not a root user, then prefix your commands with sudo

On Linux hosts, to enable auto restart after reboot,

#
systemctl enable zabbix-agent.service

If your Zabbix Server and Proxy are communicating successfully, as can be verified in the Zabbix UI ⇾ Admin ⇾ proxies page, then we can now set up the agent on the proxy itself to retrieve items.

So, on the proxy server, enter

#
nano /etc/zabbix/zabbix_agentd.conf

zabbix_agentd.conf

Key Value Notes
Server 127.0.0.1 This agent will communicate directly to the proxy process running on this same machine.
ServerActive 127.0.0.1 This agent will communicate directly to the proxy process running on this same machine.
Hostname raspberrypi Use whatever hostname you desire. You will use this name when configuring in the Zabbix UI.

Add the Agent Host to the Zabbix UI

Zabbix ⇾ Configuration ⇾ Hosts

Key Value Notes
Host Name raspberrypi I am keeping it consistent and using the same value I get when running the hostname command on the host I am running the agent.
Agent interface raspberrypi/DNS/10050 127.0.0.1/IP/10050 will also work.
Monitored by proxy raspberrypi Very important. Since the raspberrypi proxy process is managing the raspberrypi agent process, then the above Agent interface needs to know how to find the raspberrypi agent from the perspective of the raspberrypi proxy. They are on the same server, so essentially, if it resolves to 127.0.0.1 then it will work. The proxy will download configuration settings from the external Zabbix Server at regular intervals, and execute them locally, so it needs local IP addresses or hostnames as it goes through the queue of items it needs to request on behalf of the Zabbix server.
Templates Template App Zabbix Proxy
Template OS Linux by Zabbix agent
If you don't bind any templates, or add items, you won't get any data from the agent.

Troubleshooting

Double check by reading all the notes above.

Try tailing the agent and proxy logs on the proxy to see if there are any clues.

tail -f /var/log/zabbix/zabbix_agentd.log
tail -f /var/log/zabbix/zabbix_proxy.log

Zabbix Proxy by default will update its cache from the Zabbix server every 10 seconds. In older versions of Zabbix, this interval was once every 1 hour. In that case, if you made any changes to the host configurations, instead of waiting up to an hour for the Proxy to get the new information, you could trigger it sooner by entering the config_cache_reload command below.

sudo zabbix_proxy -R config_cache_reload

Comments