Active agent auto-registration

We just explored network discovery—it scanned a network range. Zabbix also supports a feature that goes the other way around, where Zabbix agents can chime in and Zabbix server can automatically start monitoring them. This is called active agent auto-registration.

Whenever a Zabbix agent connects to the Zabbix server, the server compares the incoming agent hostname with the existing hosts. If a host with the same name exists, it proceeds with the normal active item monitoring sequence. This includes both enabled and disabled hosts. If the host does not exist, the auto-registration sequence kicks in, that is, an event is generated.

The fact that an event is generated every time an unknown agent connects to the Zabbix server is important. If you do not use active items or auto-registration, switch off active checks on the agent side. Otherwise, every such check results in a network connection, a log entry on the agent and server side, and an event in the Zabbix database. There have been cases where that increases the database size and results in significantly reduced performance. In some instances, there are millions of such completely useless auto-registration events, which is up to 90% of the total event count. It is recommended checking the server log for entries such as the following:

cannot send list of active checks to [127.0.0.1]: host [Register me] not found 

If found, they should all be solved. The first pair of square brackets tells us where the connection came from, and second, what host the agent claimed to be.

Similar to trigger and network discovery events, we may react to that event with an action. Let's configure an auto-registration action now:

  1. Head to Configuration | Actions and switch to Auto registration in the Event source dropdown.
  2. Then, click on Create action.
  3. Enter Testing registration in the Name field, and then switch to the Operations tab.
  4. Click on New in the operations block. The Operation type dropdown reveals a subset of operations that are available for network discovery.

In previous versions, we could not remove hosts, remove hosts from host groups, and unlink hosts from templates, but now it seems that this has been fixed. The operations are functionally the same as for network discovery, so we won't look into them much, just choose Add host this time, and click on the small Add  in the Operation details block. Then, click on the Add button at the bottom. With the action in place, probably the easiest way to test this is to fake a new agent. Edit the agent daemon configuration file on A test host and change the Hostname parameter to Register me. Then, restart the agent daemon.

Go to Configuration | Hosts—there's a new host again. If you check the host properties, it is included in the Discovered hosts group; the same group is used here as in the network discovery. Let's change the Hostname parameter back to the previous value in the agent daemon configuration file and restart the agent.

We haven't looked at the conditions for auto-registration yet—let's return to Configuration | Actions, click on Testing registration, and switch to the Conditions tab. The drop-down next to the New condition section reveals the available conditions:

As we can see, the list of available conditions is much shorter here. We can filter by hostname. For example, if all our Linux hosts have linux in the name, we could detect them that way. We can also filter by proxy if we use Zabbix proxies for the auto-registration. There's also an entry called Host metadataWhat's that?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset