Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Documentation 6.

4 (current) Español Search

Esta es una traducción de la página de documentación original en español. Ayúdanos a mejorarla.

2 Active agent autoregistration


Zabbix Manual
Table of Contents

1 Introducción

2 De niciones Overview
2 Active agent autoregistration
3. Procesos Zabbix It is possible to allow active Zabbix agent autoregistration, after which the server can start monitoring them. This way new hosts can be added for monitoring
without con guring them manually on the server. Overview
4. Instalación
Autoregistration can happen when a previously unknown active agent asks for checks. Con guration
5. Quickstart
Specify server
6. Zabbix Appliance The feature might be very handy for automatic monitoring of new Cloud nodes. As soon as you have a new node in the Cloud Zabbix will automatically start the
collection of performance and availability data of the host. Action for active agent autoregistration
7. Con guración
Active agent autoregistration also supports the monitoring of added hosts with passive checks. When the active agent asks for checks, providing it has the 'ListenIP'
8. Service monitoring Secure autoregistration
or 'ListenPort' con guration parameters de ned in the con guration le, these are sent along to the server. (If multiple IP addresses are speci ed, the rst one is
9 Monitorización web sent to the server.)
Using DNS as default interface

10. Virtual machine monitoring Server, when adding the new autoregistered host, uses the received IP address and port to con gure the agent. If no IP address value is received, the one used for Using host metadata
the incoming connection is used. If no port value is received, 10050 is used.
11. Maintenance Example 1
It is possible to specify that the host should be autoregistered with a DNS name as the default agent interface.
12 Expresiones regulares Frontend con guration

13. Reconocimiento de problemas Autoregistration is rerun:


Agent con guration

14. Exportación e importación de con guración if host metadata information changes: Example 2
due to HostMetadata changed and agent restarted
15. Discovery Frontend con guration
due to value returned by HostMetadataItem changed
1 Network discovery Agent con guration
for manually created hosts with metadata missing
2 Active agent autoregistration if a host is manually changed to be monitored by another Zabbix proxy Frontend con guration
if autoregistration for the same host comes from a new Zabbix proxy
3 Low-level discovery Agent con guration

16. Distributed monitoring


Con guration
Specify server
17. Encryption
Make sure you have the Zabbix server identi ed in the agent con guration le - zabbix_agentd.conf
18. Interfaz web

19. API ServerActive=10.0.0.1

20. Extensions
Unless you speci cally de ne a Hostname in zabbix_agentd.conf, the system hostname of agent location will be used by server for naming the host. The system hostname in Linux can be obtained by running the 'hostname'
21. Apéndices
command.
22. Quick reference guides
If Hostname is de ned in Zabbix agent con guration as a comma-delimited list of hosts, hosts will be created for all listed hostnames.
Centro de desarrollo
Restart the agent after making any changes to the con guration le.

Manuales de Referencia de Zabbix


Action for active agent autoregistration
When server receives an autoregistration request from an agent it calls an action. An action of event source "Autoregistration" must be con gured for agent autoregistration.

Note: Setting up network discovery is not required to have active agents autoregister.

In the Zabbix frontend, go to Con guration → Actions, select Autoregistration as the event source and click on Create action:

In the Action tab, give your action a name


Optionally specify conditions. You can do a substring match or regular expression match in the conditions for host name/host metadata. If you are going to use the "Host metadata" condition, see the next section.
In the Operations tab, add relevant operations, such as - 'Add host', 'Add to host group' (for example, Discovered hosts), 'Link to templates', etc.

Note: If the hosts that will be autoregistering are likely to be supported for active monitoring only (such as hosts that are rewalled from your Zabbix server) then you might want to create a speci c template like
Template_Linux-active to link to.

Created hosts are added to the Discovered hosts group (by default, con gurable in Administration → General → Other). If you wish hosts to be added to another group, add a Remove from host group operation (specifying
"Discovered hosts") and also add an Add to host group operation (specifying another host group), because a host must belong to a host group.

Secure autoregistration
A secure way of autoregistration is possible by con guring PSK-based authentication with encrypted connections.

The level of encryption is con gured globally in Administration → General, in the Autoregistration section accessible through the dropdown to the right. It is possible to select no encryption, TLS encryption with PSK
authentication or both (so that some hosts may register without encryption while others through encryption).

Authentication by PSK is veri ed by Zabbix server before adding a host. If successful, the host is added and Connections from/to host are set to 'PSK' only with identity/pre-shared key the same as in the global autoregistration
setting.

Attention: To ensure security of autoregistration on installations using proxies, encryption between Zabbix server and proxy should be enabled.

Using DNS as default interface


HostInterface and HostInterfaceItem con guration parameters allow to specify a custom value for the host interface during autoregistration.

More speci cally, they are useful if the host should be autoregistered with a DNS name as the default agent interface rather than its IP address. In that case the DNS name should be speci ed or returned as the value of eithe
HostInterface or HostInterfaceItem parameters. Note that if the value of one of the two parameters changes, the autoregistered host interface is updated. So it is possible to update the default interface to another DNS name
or update it to an IP address. For the changes to take e ect though, the agent has to be restarted.

Note: If HostInterface or HostInterfaceItem parameters are not con gured, the listen_dns parameter is resolved from the IP address. If such resolving is con gured incorrectly, it may break autoregistration because of
invalid hostname.

Using host metadata


When agent is sending an autoregistration request to the server it sends its hostname. In some cases (for example, Amazon cloud nodes) a hostname is not enough for Zabbix server to di erentiate discovered hosts. Host
metadata can be optionally used to send other information from an agent to the server.

Host metadata is con gured in the agent con guration le - zabbix_agentd.conf. There are 2 ways of specifying host metadata in the con guration le:

HostMetadata
HostMetadataItem

See the description of the options in the link above.

Attention: An autoregistration attempt happens every time an active agent sends a request to refresh active checks to the server. The delay between requests is speci ed in the RefreshActiveChecks parameter of the
agent. The rst request is sent immediately after the agent is restarted.

Example 1
Using host metadata to distinguish between Linux and Windows hosts.

Say you would like the hosts to be autoregistered by the Zabbix server. You have active Zabbix agents (see "Con guration" section above) on your network. There are Windows hosts and Linux hosts on your network and you
have "Linux by Zabbix agent" and "Windows by Zabbix agent" templates available in your Zabbix frontend. So at host registration, you would like the appropriate Linux/Windows template to be applied to the host being
registered. By default, only the hostname is sent to the server at autoregistration, which might not be enough. In order to make sure the proper template is applied to the host you should use host metadata.

Frontend con guration


The rst thing to do is to con gure the frontend. Create 2 actions. The rst action:

Name: Linux host autoregistration


Conditions: Host metadata contains Linux
Operations: Link to templates: Linux

Note: You can skip an "Add host" operation in this case. Linking to a template requires adding a host rst so the server will do that automatically.

The second action:

Name: Windows host autoregistration


Conditions: Host metadata contains Windows
Operations: Link to templates: Windows

Agent con guration


Now you need to con gure the agents. Add the next line to the agent con guration les:

HostMetadataItem=system.uname

This way you make sure host metadata will contain "Linux" or "Windows" depending on the host an agent is running on. An example of host metadata in this case:

Linux: Linux server3 3.2.0-4-686-pae #1 SMP Debian 3.2.41-2 i686 GNU/Linux


Windows: Windows WIN-0PXGGSTYNHO 6.0.6001 Windows Server 2008 Service Pack 1 Intel IA-32

Do not forget to restart the agent after making any changes to the con guration le.

Example 2
Step 1

Using host metadata to allow some basic protection against unwanted hosts registering.

Frontend con guration


Create an action in the frontend, using some hard-to-guess secret code to disallow unwanted hosts:

Name: Autoregistration action Linux


Conditions:

* Type of calculation: AND


* Condition (A): Host metadata contains //Linux//
* Condition (B): Host metadata contains //21df83bf21bf0be663090bb8d4128558ab9b95fba66a6dbf834f8b91ae5e08ae//
* Operations:
* Send message to users: Admin via all media
* Add to host groups: Linux servers
* Link to templates: Linux

Please note that this method alone does not provide strong protection because data is transmitted in plain text. Con guration cache reload is required for changes to have an immediate e ect.

Agent con guration


Add the next line to the agent con guration le:

HostMetadata=Linux 21df83bf21bf0be663090bb8d4128558ab9b95fba66a6dbf834f8b91ae5e08ae

where "Linux" is a platform, and the rest of the string is the hard-to-guess secret text.

Do not forget to restart the agent after making any changes to the con guration le.

Step 2

It is possible to add additional monitoring for an already registered host.

Frontend con guration


Update the action in the frontend:

Name: Autoregistration action Linux


Conditions:

* Type of calculation: AND


* Condition (A): Host metadata contains Linux
* Condition (B): Host metadata contains 21df83bf21bf0be663090bb8d4128558ab9b95fba66a6dbf834f8b91ae5e08ae
* Operations:
* Send message to users: Admin via all media
* Add to host groups: Linux servers
* Link to templates: Linux
* Link to templates: MySQL by Zabbix Agent

Agent con guration


Update the next line in the agent con guration le:

HostMetadata=MySQL on Linux 21df83bf21bf0be663090bb8d4128558ab9b95fba66a6dbf834f8b91ae5e08ae

Do not forget to restart the agent after making any changes to the con guration le.

To toggle highlighting press: Ctrl+Alt+H


Have an improvement suggestion for this page? Select a text that could be improved and press Ctrl+Enter to send it to editors.

© 2001-2023 by Zabbix SIA. All rights reserved. Except where otherwise noted, Zabbix Documentation is licensed under the following license Trademark Policy

You might also like