Steps to ensure correct operation of templates that collect metrics with Zabbix agent 2:
1. Make sure that the agent 2 is installed on the host, and that the installed version contains required plugin. Follow the steps on this page if you need to update the agent 2.
2. Link the template to a target host (if the template is not available in your Zabbix installation, you may need to import the template's .xml file first - see Templates out-of-the-box section for instructions).
3. Adjust the values of mandatory macros as needed. Note, that user macros can be used to override configuration parameters.
4. Configure the instance being monitored to allow sharing data with Zabbix - see instructions in the Additional steps/comments column.
| Template name | Mandatory macros | Additional steps/comments |
|---|---|---|
| Template App Docker | - | Works with Docker plugin; named sessions are not supported. To set path to Docker API endpoint edit Plugins.Docker.Endpoint parameter in the agent 2 configuration file (default: Plugins.Docker.Endpoint=unix:///var/run/docker.sock). To test availability, run: zabbix_get -s docker-host -k docker.info |
| Template App Memcached | {$MEMCACHED.CONN.URI} - connection string in the URI format; port is optional; password is not used. If not set, the plugin's default value is used: tcp://localhost:11211. Examples: tcp://127.0.0.1:11211, tcp://localhost, unix:/var/run/memcached.sock. | Works with Memcached plugin; named sessions are supported. To test availability, run: zabbix_get -s memcached-host -k memcached.ping |
| Template DB MySQL by Zabbix agent 2 | {$MYSQL.DSN} - the system data source name of the MySQL instance (default: <Put your DSN>). Can be a session name or a URI defined in the following format: <protocol(host:port or /path/to/socket)/> For URI only TCP and Unix schemas are supported. Examples: MySQL1, tcp://localhost:3306, tcp://172.16.0.10, unix:/var/run/mysql.sock {MYSQL.USER}, {MYSQL.PASSWORD} - MySQL credentials (default: none). Required, if {$MYSQL.DSN} is a URI. Must be empty, if {$MYSQL.DSN} is a session name. | Works with MySQL plugin; named sessions are supported. To grant required privileges to a MySQL user that will be used for monitoring, run: GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO '<username>'@'%'; See MySQL documentation for information about user privileges and Unix sockets. |
| Template DB PostgreSQL by Zabbix agent 2 | {$PG.DB} - database name to connect to the server (default: postgres) {$PG.HOST} - database server host or socket directory (default: postgresql://localhost:5432127.0.0.1) {$PG.PORT} - database server port (default: 5432) {$PG.URI} -connection string; can be a session name or a URI defined in the following format: <protocol(host:port or /path/to/socket)/>. For URI only TCP and Unix schemas are supported. Examples: Postgres1, tcp://localhost:5432, tcp://172.16.0.10 {$PG.USER}, {$PG.PASSWORD} - PostgreSQL credentials (default username: postgres, password:postgres). Required, if {$PG.URI} is a URI. Must be empty, if {$PG.URI} is a session name. | Works with PostgreSQL plugin; named sessions are supported. To create a user with required privileges, for PostgreSQL 10 and newer, run: CREATE USER zbx_monitor WITH PASSWORD '<PASSWORD>' INHERIT;GRANT pg_monitor TO zbx_monitor;for older PostgreSQL versions, run: CREATE USER zbx_monitor WITH PASSWORD '<PASSWORD>'; GRANT SELECT ON pg_stat_database TO zbx_monitor; |
| Template DB Redis | {$REDIS.CONN.URI} -connection string in the URI format; port is optional; password is not used. If not set, the plugin's default value is used: tcp://localhost:6379 | Works with Redis plugin; named sessions are supported. To test availability, run: zabbix_get -s redis-master -k redis.ping |