In this post, we’ll explain the differences between Auto-registration and Auto-discovery in Zabbix. Both options have the advantage that we don’t need to add our servers to Zabbix manually.
Auto-registration allows a Zabbix server to automatically monitor a new machine if it has a Zabbix agent installed (active mode), and take predefined actions upon registration.
Auto-discovery enables periodic network scans to find external services (Web, DB, email…) or Zabbix agents (in passive mode) and take predefined actions when found. The downside of Auto-discovery is the time and resources needed to constantly scan.
Auto-registration - Configure Zabbix
To enable auto-registration, we need to create two actions in Zabbix: one for Linux servers and another for Windows. Go to “Configuration > Actions” and click the blue “Create Action” button.
In the first tab, give the action a name and set the condition: “Host metadata equals Linux”, then click “Add”:
Go to the “Operations” tab, click “New”, and fill in the details to link the “Template OS Linux”. Then click “Add” and again “Add” to confirm:
Now repeat the same steps for Windows. The final result should be:
Auto-registration - Configure the agent
In a previous post we explained how to install the Zabbix agent. To use auto-registration, set the ServerActive parameter in your agent config:
Server=10.20.10.XX
ServerActive=10.20.10.XX
Hostname=Zabbix server
HostMetadata=Linux Server Web
In HostMetadata you must specify if the server is Linux or Windows.
If using the Windows installer:
Once the agent is configured and the service is restarted, the hosts will self-register. Go to “Configuration > Hosts” to see them.
Auto-discovery - Configure Zabbix
To register servers using Auto-discovery, go to “Configuration > Actions” and select “Discovery” in the dropdown. Create two actions: one for Linux and one for Windows. Click the blue “Create Action” button, name the action, and add the condition “Received value equals” with the value Linux, then click “Add”:
Go to the “Operations” tab, click “New”, fill in the details to link the “Template OS Linux” and click “Add”:
Repeat the same for Windows. The final result should be:
Now go to “Configuration > Discovery” and click “Create discovery rule”. Set the IP range to scan, then under “Checks” click “New” and choose “Zabbix agent”, use port 10050 and set the item to monitor as system.uname. The “Update interval” defines how often Zabbix scans — avoid low values to reduce network load. If you need quick host detection, Auto-registration is a better option. After filling everything in, click “Add” and then confirm: