Automating host creation with active agent autoregistration
Using discovery to set up your Zabbix agents is a very useful method to automate your host creation. But what if we want to be even more upfront with our environment and automate further? That’s when we use a Zabbix feature called active agent autoregistration.
Getting ready
For this recipe, we will need a new Linux host. We will call this host lar-book-lnx-agent-auto
. Make sure to install Zabbix agent 2 on this host. Besides this new host, we’ll also need our Zabbix server.
How to do it…
- Let’s start by logging in to our new
lar-book-lnx-agent-auto
host and changing the following file:vim /etc/zabbix/zabbix_agent2.conf
- We will then edit the following line in the file. Make sure to enter your Zabbix server IP on this line:
ServerActive=10.16.16.152
- We can also change the following line in the file if we want to set our hostname in the file manually:
Hostname=lar-book—lnx...