You’ll need to have finished Chapter 6, Using discovery for Automatic Creation, or have some discovery rules and active agent autoregistration setup.
I’ll be using
lar-book-disc-win hosts in this example. We will also need our Zabbix server.
How to do it…
- Log in to the CLI of
lar-book-disc-lnxand edit the
/etc/zabbix/zabbix_agent2.conffile. Edit the following lines to include our Zabbix proxy address:
- Restart your Zabbix agent by executing the following command:
systemctl restart zabbix_agent2
- Now, make sure to log in to
lar-book-disc-winand edit the
C:\Program Files\Zabbix agent\zabbix_agentdfile. Edit the following lines to include our Zabbix proxy address:
At the ServerActive lines in our configuration files make sure to only include the Zabbix proxy we want to send data to. Zabbix agent will actively try to send data to our Proxy or Server listed here, so we should only list the one we want to use.
- Restart your Zabbix agent by executing the following commands in the Windows command line:
zabbix_agentd.exe --stop zabbix_agentd.exe --start
- Next, navigate to Configuration | Hosts and delete the discovered hosts:
We do this to prevent duplicate hosts.
- Now, navigate to Configuration | Discovery.
- Click on Discover Zabbix Agent hosts and change the Discovered by proxy field, as shown in the following screenshot:
- Click on the blue Update button, and that’s all there is to editing your discovery rule to be monitored by a proxy.
- You can now check out your newly discovered hosts under Configuration | Hosts and see that they are monitored by the proxy:
Active agent autoregistration
- Start by navigating to Configuration | Hosts and deleting
- To do active agent autoregistration to a proxy, we have to log in to our
- Edit the Zabbix agent configuration file with the following command:
- Make sure to edit the following line to the Zabbix proxy address instead of the Zabbix server address:
- Restart the Zabbix agent:
systemctl restart zabbix-agent2.service
- We can now see our host autoregister to the Zabbix proxy instead of the Zabbix server:
How it works…
If you want to learn more about the process of discovery and auto registration, check out Chapter 6, Using Discovery for Automatic Creation if you haven’t already.
It will gives you output similar to below: