#14 Complementos
Los complementos brindan una opción para ampliar las capacidades de monitoreo de Zabbix. Los complementos están escritos en el lenguaje de programación Go y son compatible solo con el agente 2 de Zabbix.
Los complementos proporcionan una alternativa a loadable módulos (escrito en C), y otros métodos para extender la funcionalidad de Zabbix, como usuario parámetros (métricas de agente), externo comprobaciones (sin agente monitoreo) y system.run[]
Zabbix agente artículo.
Las siguientes funciones son específicas del agente 2 y sus complementos:
Desde Zabbix 6.0.0, los complementos no tienen que integrarse directamente en el agente 2 y se pueden agregar como complementos externos separados (complementos cargables), lo que facilita el proceso de creación de complementos adicionales para recopilar nuevas métricas de monitoreo.
Esta página enumera los complementos nativos de Zabbix y describe los principios de configuración de complementos desde la perspectiva del usuario. Para obtener instrucciones sobre cómo escribir sus propios complementos, consulte [Pautas de desarrollo de complementos] (https://www.zabbix.com/documentation/guidelines/en/plugins).
Esta sección proporciona principios comunes de configuración de complementos y las mejores practicas
Todos los complementos se configuran usando el parámetro Plugins.*, que puede ser parte del agente 2 de Zabbix configuración file o el propio complemento archivo de configuración. Si un complemento usa un archivo de configuración separado, la ruta a este archivo debe ser especificado en el parámetro Incluir del archivo de configuración del agente 2 de Zabbix.
Cada parámetro de complemento debe tener la siguiente estructura:
Complementos.<Nombre del complemento>.<Parámetro>=<Valor>
Los nombres de los parámetros deben cumplir los siguientes requisitos:
Las sesiones con nombre representan un nivel adicional de parámetros de complemento y se puede utilizar para definir conjuntos separados de parámetros de autenticación para cada una de las instancias monitoreadas. Cada parámetro de sesión con nombre debe tener la siguiente estructura:
Complementos.<Nombre del complemento>.<Nombre de la sesión>.<Parámetro>=<Valor>
Un nombre de sesión se puede utilizar como un parámetro de clave de elemento connString en lugar de especificando un URI, nombre de usuario y contraseña por separado. En las claves de artículo, el El primer parámetro puede ser connString o Uri. Si la primera clave el parámetro coincide con un nombre de sesión especificado en el archivo de configuración, la comprobación se ejecutará utilizando parámetros de sesión con nombre. si el primero El parámetro clave no coincide con ningún nombre de sesión, se tratará como un uri.
Tenga en cuenta que:
La lista de parámetros de sesión con nombre disponibles depende del complemento, ver complemento individual configuración archivos para más detalles.
Ejemplo: El monitoreo de dos instancias "MySQL1" y "MySQL2" puede ser configurada de la siguiente manera:
Complementos.Mysql.Sessions.MySQL1.Uri=tcp://127.0.0.1:3306
Plugins.Mysql.Sessions.MySQL1.User=<Nombre de usuario para MySQL1>
Plugins.Mysql.Sessions.MySQL1.Password=<ContraseñaParaMySQL1>
Complementos.Mysql.Sessions.MySQL2.Uri=tcp://127.0.0.1:3307
Plugins.Mysql.Sessions.MySQL2.User=<Nombre de usuario para MySQL2>
Plugins.Mysql.Sessions.MySQL2.Password=<ContraseñaParaMySQL2>
Ahora, estos nombres se pueden usar como connStrings en claves en lugar de URI:
Monitoring of two instances “MySQL1” and “MySQL2”.
Configuration parameters:
Plugins.Mysql.Sessions.MySQL1.Uri=tcp://127.0.0.1:3306
Plugins.Mysql.Sessions.MySQL1.User=mysql1_user
Plugins.Mysql.Sessions.MySQL1.Password=unique_password
Plugins.Mysql.Sessions.MySQL2.Uri=tcp://192.0.2.0:3306
Plugins.Mysql.Sessions.MySQL2.User=mysql2_user
Plugins.Mysql.Sessions.MySQL2.Password=different_password
Item keys: mysql.ping[MySQL1]
, mysql.ping[MySQL2]
Providing some of the parameters in the item key (supported since Zabbix 6.0.17).
Configuration parameters:
Plugins.Postgres.Sessions.Session1.Uri=tcp://192.0.2.234:5432
Plugins.Postgres.Sessions.Session1.User=old_username
Plugins.Postgres.Sessions.Session1.Password=session_password
Item key: pgsql.ping[session1,new_username,,postgres]
As a result of this configuration, the agent will connect to PostgreSQL using the following parameters:
Si un parámetro requerido para la autenticación no se proporciona en un elemento clave o en los parámetros de sesión nombrados, el complemento utilizará un codificado valor por defecto.
Algunos complementos admiten la recopilación de métricas de múltiples instancias simultaneamente. Tanto las instancias locales como las remotas pueden ser monitoreadas. TCP y se admiten conexiones de socket Unix.
Se recomienda configurar complementos para mantener las conexiones a las instancias. en estado abierto. Los beneficios son la reducción de la congestión de la red, la latencia, y uso de CPU y memoria debido a la menor cantidad de conexiones. los la biblioteca del cliente se encarga de esto.
Período de tiempo durante el cual deben permanecer las conexiones no utilizadas abierto puede ser determinado por Plugins.<PluginName>.KeepAlive parámetro.
Ejemplo: Complementos.Memcached.KeepAlive
All metrics supported by Zabbix agent 2 are collected by plugins. The following plugins for Zabbix agent 2 are available out-of-the-box:
Plugin name | Description | Supported item keys | Comments |
---|---|---|---|
Agent | Metrics of the Zabbix agent being used. | agent.hostname, agent.ping, agent.version | Supported keys have the same parameters as Zabbix agent keys. |
Ceph | Ceph monitoring. | ceph.df.details, ceph.osd.stats, ceph.osd.discovery, ceph.osd.dump, ceph.ping, ceph.pool.discovery, ceph.status |
Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
CPU | System CPU monitoring (number of CPUs/CPU cores, discovered CPUs, utilization percentage). | system.cpu.discovery, system.cpu.num, system.cpu.util | Supported keys have the same parameters as Zabbix agent keys. |
Docker | Monitoring of Docker containers. | docker.container_info, docker.container_stats, docker.containers, docker.containers.discovery, docker.data_usage, docker.images, docker.images.discovery, docker.info, docker.ping |
Supported keys can be used with Zabbix agent 2 only. See also: Configuration parameters |
File | File metrics collection. | vfs.file.cksum, vfs.file.contents, vfs.file.exists, vfs.file.md5sum, vfs.file.regexp, vfs.file.regmatch, vfs.file.size, vfs.file.time |
Supported keys have the same parameters as Zabbix agent keys. |
Kernel | Kernel monitoring. | kernel.maxfiles, kernel.maxproc | Supported keys have the same parameters as Zabbix agent keys. |
Log | Log file monitoring. | log, log.count, logrt, logrt.count | Supported keys have the same parameters as Zabbix agent keys. See also: Plugin configuration parameters (Unix/Windows) |
Memcached | Memcached server monitoring. | memcached.ping, memchached.stats | Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
Modbus | Reads Modbus data. | modbus.get | Supported keys have the same parameters as Zabbix agent keys. See also: - Plugin documentation - Configuration parameters |
Mongo DB | Monitoring of MongoDB servers and clusters (document-based, distributed database). | mongodb.collection.stats, mongodb.collections.discovery, mongodb.collections.usage, mongodb.connpool.stats, mongodb.db.stats, mongodb.db.discovery, mongodb.jumbo_chunks.count, mongodb.oplog.stats, mongodb.ping, mongodb.rs.config, mongodb.rs.status, mongodb.server.status, mongodb.sh.discovery |
Supported MongoDB versions: 3.6, 4.0, 4.2, 4.4. Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
MQTT | Receives published values of MQTT topics. | mqtt.get | Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
MySQL | Monitoring of MySQL and its forks. | mysql.db.discovery, mysql.db.size, mysql.get_status_variables, mysql.ping, mysql.replication.discovery, mysql.replication.get_slave_status, mysql.version |
To configure encrypted connection to the database, use named sessions and specify TLS parameters for the named session in the agent configuration file. Currently, TLS parameters cannot be passed as item key parameters. Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
NetIf | Monitoring of network interfaces. | net.if.collisions, net.if.discovery, net.if.in, net.if.out, net.if.total | Supported keys have the same parameters as Zabbix agent keys. |
Oracle | Oracle Database monitoring. | oracle.diskgroups.stats, oracle.diskgroups.discovery, oracle.archive.info, oracle.archive.discovery, oracle.cdb.info, oracle.custom.query, oracle.datafiles.stats, oracle.db.discovery, oracle.fra.stats, oracle.instance.info, oracle.pdb.info, oracle.pdb.discovery, oracle.pga.stats, oracle.ping, oracle.proc.stats, oracle.redolog.info, oracle.sga.stats, oracle.sessions.stats, oracle.sys.metrics, oracle.sys.params, oracle.ts.stats, oracle.ts.discovery, oracle.user.info |
Install the Oracle Instant Client before using the plugin. Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
PostgreSQL | Monitoring of PostgreSQL and its forks. | pgsql.ping, pgsql.db.discovery, pgsql.db.size, pgsql.db.age, pgsql.database.bloating_tables, pgsql.replication_lag.sec, pgsql.replication_lag.b, pgsql.replication.count, pgsql.replication.status, pgsql.replication.recovery_role, pgsql.cache.hit, pgsql.connections, pgsql.archive, pgsql.bgwriter, pgsql.dbstat.sum, pgsql.dbstat, pgsql.wal.stat, pgsql.locks, pgsql.pgsql.oldest.xid, pgsql.uptime |
To configure encrypted connection to the database, use named sessions and specify TLS parameters for the named session in the agent configuration file. Currently, TLS parameters cannot be passed as item key parameters. Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
Proc | Process CPU utilization percentage. | proc.cpu.util | Supported key has the same parameters as Zabbix agent key. |
Redis | Redis server monitoring. | redis.config, redis.info, redis.ping, redis.slowlog.count | Supported keys can be used with Zabbix agent 2 only. See also: - Plugin documentation - Configuration parameters |
Smart | S.M.A.R.T. monitoring. | smart.attribute.discovery, smart.disk.discovery, smart.disk.get | Sudo/root access rights to smartctl are required for the user executing Zabbix agent 2. The minimum required smartctl version is 7.1. Supported keys can be used with Zabbix agent 2 only on Linux/Windows, both as a passive and active check. See also: Configuration parameters |
Swap | Swap space size in bytes/percentage. | system.swap.size | Supported key has the same parameters as Zabbix agent key. |
SystemRun | Runs specified command. | system.run | Supported key has the same parameters as Zabbix agent key. See also: Plugin configuration parameters (Unix/Windows) |
Systemd | Monitoring of systemd services. | systemd.unit.discovery, systemd.unit.get, systemd.unit.info | Supported keys can be used with Zabbix agent 2 only. |
TCP | TCP connection availability check. | net.tcp.port | Supported key has the same parameters as Zabbix agent key. |
UDP | Monitoring of the UDP services avaiability and performance. | net.udp.service, net.udp.service.perf | Supported keys have the same parameters as Zabbix agent keys. |
Uname | Retrieval of information about the system. | system.hostname, system.sw.arch, system.uname | Supported keys have the same parameters as Zabbix agent keys. |
Uptime | System uptime metrics collection. | system.uptime | Supported key has the same parameters as Zabbix agent key. |
VFSDev | VFS metrics collection. | vfs.dev.discovery, vfs.dev.read, vfs.dev.write | Supported keys have the same parameters as Zabbix agent keys. |
WebCertificate | Monitoring of TLS/SSL website certificates. | web.certificate.get | Supported key can be used with Zabbix agent 2 only. |
WebPage | Web page monitoring. | web.page.get, web.page.perf, web.page.regexp | Supported keys have the same parameters as Zabbix agent keys. |
ZabbixAsync | Asynchronous metrics collection. | net.tcp.listen, net.udp.listen, sensor, system.boottime, system.cpu.intr, system.cpu.load, system.cpu.switches, system.hw.cpu, system.hw.macaddr, system.localtime, system.sw.os, system.swap.in, system.swap.out, vfs.fs.discovery |
Supported keys have the same parameters as Zabbix agent keys. |
ZabbixStats | Zabbix server/proxy internal metrics or number of delayed items in a queue. | zabbix.stats | Supported keys have the same parameters as Zabbix agent keys. |
ZabbixSync | Synchronous metrics collection. | net.dns, net.dns.record, net.tcp.service, net.tcp.service.perf, proc.mem, proc.num, system.hw.chassis, system.hw.devices, system.sw.packages, system.users.num, vfs.dir.count, vfs.dir.size, vfs.fs.get, vfs.fs.inode, vfs.fs.size, vm.memory.size. |
Supported keys have the same parameters as Zabbix agent keys. |
The following plugins for Zabbix agent 2 are available out-of-the-box. Click on the plugin name to go to the plugin repository with additional information.
Plugin name | Description | Supported item keys | Comments |
---|---|---|---|
Agent | Metrics of the Zabbix agent being used. | agent.hostname, agent.ping, agent.version | Supported keys have the same parameters as Zabbix agent keys. |
Ceph | Ceph monitoring. | ceph.df.details, ceph.osd.stats, ceph.osd.discovery, ceph.osd.dump, ceph.ping, ceph.pool.discovery, ceph.status |
|
CPU | System CPU monitoring (number of CPUs/CPU cores, discovered CPUs, utilization percentage). | system.cpu.discovery, system.cpu.num, system.cpu.util | Supported keys have the same parameters as Zabbix agent keys. |
Docker | Monitoring of Docker containers. | docker.container_info, docker.container_stats, docker.containers, docker.containers.discovery, docker.data_usage, docker.images, docker.images.discovery, docker.info, docker.ping |
See also: Configuration parameters |
File | File metrics collection. | vfs.file.cksum, vfs.file.contents, vfs.file.exists, vfs.file.md5sum, vfs.file.regexp, vfs.file.regmatch, vfs.file.size, vfs.file.time |
Supported keys have the same parameters as Zabbix agent keys. |
Kernel | Kernel monitoring. | kernel.maxfiles, kernel.maxproc | Supported keys have the same parameters as Zabbix agent keys. |
Log | Log file monitoring. | log, log.count, logrt, logrt.count | Supported keys have the same parameters as Zabbix agent keys. See also: Plugin configuration parameters (Unix/Windows) |
Memcached | Memcached server monitoring. | memcached.ping, memchached.stats | |
Modbus | Reads Modbus data. | modbus.get | Supported keys have the same parameters as Zabbix agent keys. |
MQTT | Receives published values of MQTT topics. | mqtt.get | |
MySQL | Monitoring of MySQL and its forks. | mysql.db.discovery, mysql.db.size, mysql.get_status_variables, mysql.ping, mysql.replication.discovery, mysql.replication.get_slave_status, mysql.version |
To configure encrypted connection to the database, use named sessions and specify the TLS parameters for the named session in the agent configuration file. Currently, TLS parameters cannot be passed as item key parameters. |
NetIf | Monitoring of network interfaces. | net.if.collisions, net.if.discovery, net.if.in, net.if.out, net.if.total | Supported keys have the same parameters as Zabbix agent keys. |
Oracle | Oracle Database monitoring. | oracle.diskgroups.stats, oracle.diskgroups.discovery, oracle.archive.info, oracle.archive.discovery, oracle.cdb.info, oracle.custom.query, oracle.datafiles.stats, oracle.db.discovery, oracle.fra.stats, oracle.instance.info, oracle.pdb.info, oracle.pdb.discovery, oracle.pga.stats, oracle.ping, oracle.proc.stats, oracle.redolog.info, oracle.sga.stats, oracle.sessions.stats, oracle.sys.metrics, oracle.sys.params, oracle.ts.stats, oracle.ts.discovery, oracle.user.info |
Install the Oracle Instant Client before using the plugin. |
Proc | Process CPU utilization percentage. | proc.cpu.util | Supported key has the same parameters as Zabbix agent key. |
Redis | Redis server monitoring. | redis.config, redis.info, redis.ping, redis.slowlog.count | |
Smart | S.M.A.R.T. monitoring. | smart.attribute.discovery, smart.disk.discovery, smart.disk.get | Sudo/root access rights to smartctl are required for the user executing Zabbix agent 2. The minimum required smartctl version is 7.1. Supported keys can be used with Zabbix agent 2 only on Linux/Windows, both as a passive and active check. See also: Configuration parameters |
Swap | Swap space size in bytes/percentage. | system.swap.size | Supported key has the same parameters as Zabbix agent key. |
SystemRun | Runs specified command. | system.run | Supported key has the same parameters as Zabbix agent key. See also: Plugin configuration parameters (Unix/Windows) |
Systemd | Monitoring of systemd services. | systemd.unit.discovery, systemd.unit.get, systemd.unit.info | |
TCP | TCP connection availability check. | net.tcp.port | Supported key has the same parameters as Zabbix agent key. |
UDP | Monitoring of the UDP services availability and performance. | net.udp.service, net.udp.service.perf | Supported keys have the same parameters as Zabbix agent keys. |
Uname | Retrieval of information about the system. | system.hostname, system.sw.arch, system.uname | Supported keys have the same parameters as Zabbix agent keys. |
Uptime | System uptime metrics collection. | system.uptime | Supported key has the same parameters as Zabbix agent key. |
VFSDev | VFS metrics collection. | vfs.dev.discovery, vfs.dev.read, vfs.dev.write | Supported keys have the same parameters as Zabbix agent keys. |
WebCertificate | Monitoring of TLS/SSL website certificates. | web.certificate.get | |
WebPage | Web page monitoring. | web.page.get, web.page.perf, web.page.regexp | Supported keys have the same parameters as Zabbix agent keys. |
ZabbixAsync | Asynchronous metrics collection. | net.tcp.listen, net.udp.listen, sensor, system.boottime, system.cpu.intr, system.cpu.load, system.cpu.switches, system.hw.cpu, system.hw.macaddr, system.localtime, system.sw.os, system.swap.in, system.swap.out, vfs.fs.discovery |
Supported keys have the same parameters as Zabbix agent keys. |
ZabbixStats | Zabbix server/proxy internal metrics or number of delayed items in a queue. | zabbix.stats | Supported keys have the same parameters as Zabbix agent keys. |
ZabbixSync | Synchronous metrics collection. | net.dns, net.dns.record, net.tcp.service, net.tcp.service.perf, proc.mem, proc.num, system.hw.chassis, system.hw.devices, system.sw.packages, system.users.num, vfs.dir.count, vfs.dir.size, vfs.fs.get, vfs.fs.inode, vfs.fs.size, vm.memory.size. |
Supported keys have the same parameters as Zabbix agent keys. |
Loadable plugins, when launched with:
- -V --version - print plugin version and license information;
- -h --help - print help information.
Click on the plugin name to go to the plugin repository with additional information.
Plugin name | Description | Supported item keys | Comments |
---|---|---|---|
MongoDB | Monitoring of MongoDB servers and clusters (document-based, distributed database). | mongodb.collection.stats, mongodb.collections.discovery, mongodb.collections.usage, mongodb.connpool.stats, mongodb.db.stats, mongodb.db.discovery, mongodb.jumbo_chunks.count, mongodb.oplog.stats, mongodb.ping, mongodb.rs.config, mongodb.rs.status, mongodb.server.status, mongodb.sh.discovery |
|
PostgreSQL | Monitoring of PostgreSQL and its forks. | pgsql.autovacuum.count, pgsql.archive, pgsql.bgwriter, pgsql.cache.hit, pgsql.connections, pgsql.custom.query, pgsql.dbstat, pgsql.dbstat.sum, pgsql.db.age, pgsql.db.bloating_tables, pgsql.db.discovery, pgsql.db.size, pgsql.locks, pgsql.oldest.xid, pgsql.ping, pgsql.queries, pgsql.replication.count, pgsql.replication.process, pgsql.replication.process.discovery, pgsql.replication.recovery_role, pgsql.replication.status, pgsql.replication_lag.b, pgsql.replication_lag.sec, pgsql.uptime, pgsql.wal.stat |
This plugin is loadable since Zabbix 6.0.10 (built-in previously). To configure encrypted connections to the database, use named sessions and specify the TLS parameters for the named session in the agent configuration file. Currently, TLS parameters cannot be passed as item key parameters. |
See also: Building loadable plugins.
1 - Since Zabbix 6.0.13, loadable plugins started using the same versioning system as Zabbix itself. As a result, MongoDB plugin version has changed from 1.2.1 to 6.0.13.