
# MySQL by ODBC

## Overview

This template is designed for the effortless deployment of MySQL monitoring by Zabbix via ODBC and doesn't require any external scripts.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- MySQL 5.7, 8.0, 9.4
- Percona 8.4
- MariaDB 10.6, 11.8

## Configuration

> Zabbix should be configured according to the instructions in the [Templates out of the box](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box) section.

## Setup

1. Create a MySQL user for monitoring (`<password>` at your discretion):

```text
CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';
GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
```

For more information, please see MySQL documentation https://dev.mysql.com/doc/refman/8.0/en/grant.html.

**NOTE:** In order to collect replication metrics, MariaDB Enterprise Server 10.5.8-5 and above and MariaDB Community Server 10.5.9 and above require the `SLAVE MONITOR` privilege to be set for the monitoring user:

```text
GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW,SLAVE MONITOR ON *.* TO 'zbx_monitor'@'%';
```

For more information please read the MariaDB documentation https://mariadb.com/docs/server/ref/mdb/privileges/SLAVE_MONITOR/.

2. Set the username and password in the host macros `{$MYSQL.USER}` and `{$MYSQL.PASSWORD}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$MYSQL.ABORTED_CONN.MAX.WARN}|
Number of failed attempts to connect to the MySQL server for trigger expressions.
|`3`|
|{$MYSQL.REPL_LAG.MAX.WARN}|
Amount of time the slave is behind the master for trigger expressions.
|`30m`|
|{$MYSQL.SLOW_QUERIES.MAX.WARN}|
Number of slow queries for trigger expressions.
|`3`|
|{$MYSQL.BUFF_UTIL.MIN.WARN}|
The minimum buffer pool utilization in percentage for trigger expressions.
|`50`|
|{$MYSQL.DSN}|
System data source name.
|`<Put your DSN here>`|
|{$MYSQL.USER}|
MySQL username.
|`<Put your username here>`|
|{$MYSQL.PASSWORD}|
MySQL user password.
|`<Put your password here>`|
|{$MYSQL.CREATED_TMP_TABLES.MAX.WARN}|
The maximum number of temporary tables created in memory per second for trigger expressions.
|`30`|
|{$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN}|
The maximum number of temporary tables created on a disk per second for trigger expressions.
|`10`|
|{$MYSQL.CREATED_TMP_FILES.MAX.WARN}|
The maximum number of temporary files created on a disk per second for trigger expressions.
|`10`|
|{$MYSQL.INNODB_LOG_FILES}|
Number of physical files in the InnoDB redo log for calculating `innodb_log_file_size`.
|`2`|
|{$MYSQL.DBNAME.MATCHES}|
Filter of discoverable databases.
|`.+`|
|{$MYSQL.DBNAME.NOT_MATCHES}|
Filter to exclude discovered databases.
|`information_schema`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get status variables|
Gets server global status information.
|Database monitor|db.odbc.get[get_status_variables,"{$MYSQL.DSN}"]|
|Get database|
Used for scanning databases in DBMS.
|Database monitor|db.odbc.get[get_database,"{$MYSQL.DSN}"]|
|Get replication|
Gets replication status information.
|Database monitor|db.odbc.get[get_replication,"{$MYSQL.DSN}"]
**Preprocessing**

- 
Check for not supported value: `any error`

⛔️Custom on fail: Set value to: `deprecated`

- 
JavaScript: `The text is too long. Please see the template.`

|
|Status|
MySQL server status.
|Database monitor|db.odbc.select[ping,"{$MYSQL.DSN}"]
**Preprocessing**

- 
Discard unchanged with heartbeat: `10m`

|
|Version|
MySQL server version.
|Database monitor|db.odbc.select[version,"{$MYSQL.DSN}"]
**Preprocessing**

- 
Discard unchanged with heartbeat: `6h`

|
|Uptime|
Number of seconds that the server has been up.
|Dependent item|mysql.uptime
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Uptime')].Value.first()`

|
|Aborted clients per second|
Number of connections that were aborted because the client died without closing the connection properly.
|Dependent item|mysql.aborted_clients.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Aborted_clients')].Value.first()`

- Change per second
|
|Aborted connections per second|
Number of failed attempts to connect to the MySQL server.
|Dependent item|mysql.aborted_connects.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Aborted_connects')].Value.first()`

- Change per second
|
|Connection errors accept per second|
Number of errors that occurred during calls to `accept()` on the listening port.
|Dependent item|mysql.connection_errors_accept.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Connection errors internal per second|
Number of refused connections due to internal server errors, for example, out of memory errors, or failed thread starts.
|Dependent item|mysql.connection_errors_internal.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Connection errors max connections per second|
Number of refused connections due to the `max_connections` limit being reached.
|Dependent item|mysql.connection_errors_max_connections.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Connection errors peer address per second|
Number of errors while searching for the connecting client's IP address.
|Dependent item|mysql.connection_errors_peer_address.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Connection errors select per second|
Number of errors during calls to `select()` or `poll()` on the listening port. The client would not necessarily have been rejected in these cases.
|Dependent item|mysql.connection_errors_select.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Connection errors tcpwrap per second|
Number of connections the libwrap library has refused.
|Dependent item|mysql.connection_errors_tcpwrap.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Connections per second|
Number of connection attempts (successful or not) to the MySQL server.
|Dependent item|mysql.connections.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Connections')].Value.first()`

- Change per second
|
|Max used connections|
The maximum number of connections that have been in use simultaneously since the server start.
|Dependent item|mysql.max_used_connections
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Max_used_connections')].Value.first()`

- 
Discard unchanged with heartbeat: `1h`

|
|Threads cached|
Number of threads in the thread cache.
|Dependent item|mysql.threads_cached
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Threads_cached')].Value.first()`

|
|Threads connected|
Number of currently open connections.
|Dependent item|mysql.threads_connected
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Threads_connected')].Value.first()`

|
|Threads created per second|
Number of threads created to handle connections. If the value of `Threads_created` is large, you may want to increase the `thread_cache_size` value. The cache miss rate can be calculated as `Threads_created`/`Connections`.
|Dependent item|mysql.threads_created.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Threads_created')].Value.first()`

- Change per second
|
|Threads running|
Number of threads that are not sleeping.
|Dependent item|mysql.threads_running
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Threads_running')].Value.first()`

|
|Buffer pool efficiency|
The item shows how effectively the buffer pool is serving reads.
|Calculated|mysql.buffer_pool_efficiency|
|Buffer pool utilization|
Ratio of used to total pages in the buffer pool.
|Calculated|mysql.buffer_pool_utilization|
|Created tmp files on disk per second|
How many temporary files `mysqld` has created.
|Dependent item|mysql.created_tmp_files.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Created_tmp_files')].Value.first()`

- Change per second
|
|Created tmp tables on disk per second|
Number of internal on-disk temporary tables created by the server while executing statements.
|Dependent item|mysql.created_tmp_disk_tables.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|Created tmp tables on memory per second|
Number of internal temporary tables created by the server while executing statements.
|Dependent item|mysql.created_tmp_tables.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Created_tmp_tables')].Value.first()`

- Change per second
|
|InnoDB buffer pool pages free|
The total size of the InnoDB buffer pool, in pages.
|Dependent item|mysql.innodb_buffer_pool_pages_free
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

|
|InnoDB buffer pool pages total|
The total size of the InnoDB buffer pool, in pages.
|Dependent item|mysql.innodb_buffer_pool_pages_total
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `1h`

|
|InnoDB buffer pool read requests|
Number of logical read requests.
|Dependent item|mysql.innodb_buffer_pool_read_requests
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

|
|InnoDB buffer pool read requests per second|
Number of logical read requests per second.
|Dependent item|mysql.innodb_buffer_pool_read_requests.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|InnoDB buffer pool reads|
Number of logical reads that InnoDB could not satisfy from the buffer pool and had to read directly from the disk.
|Dependent item|mysql.innodb_buffer_pool_reads
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

|
|InnoDB buffer pool reads per second|
Number of logical reads per second that InnoDB could not satisfy from the buffer pool and had to read directly from the disk.
|Dependent item|mysql.innodb_buffer_pool_reads.rate
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- Change per second
|
|InnoDB row lock time|
The total time spent in acquiring row locks for InnoDB tables, in milliseconds.
|Dependent item|mysql.innodb_row_lock_time
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Innodb_row_lock_time')].Value.first()`

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `1h`

|
|InnoDB row lock time max|
The maximum time to acquire a row lock for InnoDB tables, in milliseconds.
|Dependent item|mysql.innodb_row_lock_time_max
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `1h`

|
|InnoDB row lock waits|
Number of times operations on InnoDB tables had to wait for a row lock.
|Dependent item|mysql.innodb_row_lock_waits
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Innodb_row_lock_waits')].Value.first()`

|
|Slow queries per second|
Number of queries that have taken more than `long_query_time` seconds.
|Dependent item|mysql.slow_queries.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Slow_queries')].Value.first()`

- Change per second
|
|Bytes received|
Number of bytes received from all clients.
|Dependent item|mysql.bytes_received.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Bytes_received')].Value.first()`

- Change per second
|
|Bytes sent|
Number of bytes sent to all clients.
|Dependent item|mysql.bytes_sent.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Bytes_sent')].Value.first()`

- Change per second
|
|Command Delete per second|
The `Com_delete` counter variable indicates the number of times the `DELETE` statement has been executed.
|Dependent item|mysql.com_delete.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Com_delete')].Value.first()`

- Change per second
|
|Command Insert per second|
The `Com_insert` counter variable indicates the number of times the `INSERT` statement has been executed.
|Dependent item|mysql.com_insert.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Com_insert')].Value.first()`

- Change per second
|
|Command Select per second|
The `Com_select` counter variable indicates the number of times the `SELECT` statement has been executed.
|Dependent item|mysql.com_select.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Com_select')].Value.first()`

- Change per second
|
|Command Update per second|
The `Com_update` counter variable indicates the number of times the `UPDATE` statement has been executed.
|Dependent item|mysql.com_update.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Com_update')].Value.first()`

- Change per second
|
|Queries per second|
Number of statements executed by the server. This variable includes statements executed within stored programs, unlike the `Questions` variable.
|Dependent item|mysql.queries.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Queries')].Value.first()`

- Change per second
|
|Questions per second|
Number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the `Queries` variable.
|Dependent item|mysql.questions.rate
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Questions')].Value.first()`

- Change per second
|
|Binlog cache disk use|
Number of transactions that used a temporary disk cache because they could not fit in the regular binary log cache, being larger than `binlog_cache_size`.
|Dependent item|mysql.binlog_cache_disk_use
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Binlog_cache_disk_use')].Value.first()`

- 
Discard unchanged with heartbeat: `6h`

|
|Innodb buffer pool wait free|
Number of times InnoDB waited for a free page before reading or creating a page. Normally, writes to the InnoDB buffer pool happen in the background. When no clean pages are available, dirty pages are flushed first in order to free some up. This counts the numbers of wait for this operation to finish. If this value is not small, look at the increasing `innodb_buffer_pool_size`.
|Dependent item|mysql.innodb_buffer_pool_wait_free
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `6h`

|
|Innodb number open files|
Number of open files held by InnoDB. InnoDB only.
|Dependent item|mysql.innodb_num_open_files
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Innodb_num_open_files')].Value.first()`

- 
Discard unchanged with heartbeat: `6h`

|
|Open table definitions|
Number of cached table definitions.
|Dependent item|mysql.open_table_definitions
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `6h`

|
|Open tables|
Number of tables that are open.
|Dependent item|mysql.open_tables
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Open_tables')].Value.first()`

- 
Discard unchanged with heartbeat: `6h`

|
|Innodb log written|
Number of bytes written to the InnoDB log.
|Dependent item|mysql.innodb_os_log_written
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Innodb_os_log_written')].Value.first()`

- 
Discard unchanged with heartbeat: `6h`

|
|Calculated value of innodb_log_file_size|
`Innodb_log_file_size` is calculated as: (`innodb_os_log_written`-`innodb_os_log_written`(time shift -1h))/`{$MYSQL.INNODB_LOG_FILES}`. `Innodb_log_file_size` is the size in bytes of the each InnoDB redo log file in the log group. The combined size can be no more than 512 GB. Larger values mean less disk I/O due to less flushing checkpoint activity, but also slower recovery from a crash.
|Calculated|mysql.innodb_log_file_size
**Preprocessing**

- 
Discard unchanged with heartbeat: `6h`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|MySQL: Service is down|
MySQL is down.
|`last(/MySQL by ODBC/db.odbc.select[ping,"{$MYSQL.DSN}"])=0`|High||
|MySQL: Version has changed|
The MySQL version has changed. Acknowledge to close the problem manually.
|`last(/MySQL by ODBC/db.odbc.select[version,"{$MYSQL.DSN}"],#1)<>last(/MySQL by ODBC/db.odbc.select[version,"{$MYSQL.DSN}"],#2) and length(last(/MySQL by ODBC/db.odbc.select[version,"{$MYSQL.DSN}"]))>0`|Info|**Manual close**: Yes|
|MySQL: Service has been restarted|
MySQL uptime is less than 10 minutes.
|`last(/MySQL by ODBC/mysql.uptime)<10m`|Info||
|MySQL: Failed to fetch info data|
Zabbix has not received any data for items for the last 30 minutes.
|`nodata(/MySQL by ODBC/mysql.uptime,30m)=1`|Info|**Depends on**:

- MySQL: Service is down
|
|MySQL: Server has aborted connections|
The number of failed attempts to connect to the MySQL server is more than `{$MYSQL.ABORTED_CONN.MAX.WARN}` in the last 5 minutes.
|`min(/MySQL by ODBC/mysql.aborted_connects.rate,5m)>{$MYSQL.ABORTED_CONN.MAX.WARN}`|Average|**Depends on**:

- MySQL: Refused connections
|
|MySQL: Refused connections|
Number of refused connections due to the `max_connections` limit being reached.
|`last(/MySQL by ODBC/mysql.connection_errors_max_connections.rate)>0`|Average||
|MySQL: Buffer pool utilization is too low|
The buffer pool utilization is less than `{$MYSQL.BUFF_UTIL.MIN.WARN}`% in the last 5 minutes. This means that there is a lot of unused RAM allocated for the buffer pool, which you can easily reallocate at the moment.
|`max(/MySQL by ODBC/mysql.buffer_pool_utilization,5m)<{$MYSQL.BUFF_UTIL.MIN.WARN}`|Warning||
|MySQL: Number of temporary files created per second is high|
The application using the database may be in need of query optimization.
|`min(/MySQL by ODBC/mysql.created_tmp_files.rate,5m)>{$MYSQL.CREATED_TMP_FILES.MAX.WARN}`|Warning||
|MySQL: Number of on-disk temporary tables created per second is high|
The application using the database may be in need of query optimization.
|`min(/MySQL by ODBC/mysql.created_tmp_disk_tables.rate,5m)>{$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN}`|Warning||
|MySQL: Number of internal temporary tables created per second is high|
The application using the database may be in need of query optimization.
|`min(/MySQL by ODBC/mysql.created_tmp_tables.rate,5m)>{$MYSQL.CREATED_TMP_TABLES.MAX.WARN}`|Warning||
|MySQL: Server has slow queries|
The number of slow queries is more than `{$MYSQL.SLOW_QUERIES.MAX.WARN}` in the last 5 minutes.
|`min(/MySQL by ODBC/mysql.slow_queries.rate,5m)>{$MYSQL.SLOW_QUERIES.MAX.WARN}`|Warning||

### LLD rule Database discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Database discovery|
Used for the discovery of the databases.
|Dependent item|mysql.database.discovery
**Preprocessing**

- 
Discard unchanged with heartbeat: `1d`

|

### Item prototypes for Database discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Size of database {#DATABASE}|
Database size.
|Database monitor|db.odbc.select[{#DATABASE}_size,"{$MYSQL.DSN}"]
**Preprocessing**

- 
Discard unchanged with heartbeat: `1h`

|

### LLD rule Replication discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Replication discovery|
Discovery of the replication.
|Dependent item|mysql.replication.discovery
**Preprocessing**

- 
Discard unchanged with heartbeat: `1d`

|

### Item prototypes for Replication discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Replication {#REPLICA.NAME} status|
Gets status information on the essential parameters of the {#REPLICA.KEY} threads.
|Database monitor|db.odbc.get["get_{#REPLICA.KEY}_status","{$MYSQL.DSN}"]
**Preprocessing**

- 
JSON Path: `$.first()`

⛔️Custom on fail: Discard value

- 
JavaScript: `The text is too long. Please see the template.`

|
|Replication {#REPLICA.NAME} SQL Running State|
Shows the state of the SQL driver threads.
|Dependent item|mysql.slave_sql_running_state["{#REPLICA.KEY}"]
**Preprocessing**

- 
JSON Path: `$.Slave_SQL_Running_State`

- 
Discard unchanged with heartbeat: `6h`

|
|Replication Seconds Behind {#SOURCE.NAME}|
The number of seconds the {#REPLICA.KEY} SQL thread has been behind processing the {#SOURCE.KEY} binary log. A high number (or an increasing one) can indicate that the {#REPLICA.KEY} is unable to handle events from the {#SOURCE.KEY} in a timely fashion.
|Dependent item|mysql.seconds_behind_master["{#REPLICA.KEY}"]
**Preprocessing**

- 
JSON Path: `$.Seconds_Behind_Master`

- 
Matches regular expression: `\d+`

⛔️Custom on fail: Set error to: `Replication is not performed.`

- 
Discard unchanged with heartbeat: `1h`

|
|Replication {#REPLICA.NAME} IO Running|
Whether the I/O thread for reading the {#SOURCE.KEY}'s binary log is running. Normally, you want this to be `Yes` unless you have not yet started a replication or have explicitly stopped it with `stop {#REPLICA.KEY}`.
|Dependent item|mysql.slave_io_running["{#REPLICA.KEY}"]
**Preprocessing**

- 
JSON Path: `$.Slave_IO_Running`

- 
Discard unchanged with heartbeat: `1h`

|
|Replication {#REPLICA.NAME} SQL Running|
Whether the SQL thread for executing events in the relay log is running.

As with the I/O thread, this should normally be `Yes`.
|Dependent item|mysql.slave_sql_running["{#REPLICA.KEY}"]
**Preprocessing**

- 
JSON Path: `$.Slave_SQL_Running`

- 
Discard unchanged with heartbeat: `1h`

|

### Trigger prototypes for Replication discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|MySQL: Replication lag is too high|
Replication delay is too long.
|`min(/MySQL by ODBC/mysql.seconds_behind_master["{#REPLICA.KEY}"],5m)>{$MYSQL.REPL_LAG.MAX.WARN}`|Warning||
|MySQL: The {#REPLICA.KEY} I/O thread is not running|
Whether the I/O thread for reading the {#SOURCE.KEY}'s binary log is running.
|`count(/MySQL by ODBC/mysql.slave_io_running["{#REPLICA.KEY}"],#1,"eq","No")=1`|Average||
|MySQL: The {#REPLICA.KEY} I/O thread is not connected to a replication {#SOURCE.KEY}|
Whether the {#REPLICA.KEY} I/O thread is connected to the {#SOURCE.KEY}.
|`count(/MySQL by ODBC/mysql.slave_io_running["{#REPLICA.KEY}"],#1,"ne","Yes")=1`|Warning|**Depends on**:

- MySQL: The {#REPLICA.KEY} I/O thread is not running
|
|MySQL: The SQL thread is not running|
Whether the SQL thread for executing events in the relay log is running.
|`count(/MySQL by ODBC/mysql.slave_sql_running["{#REPLICA.KEY}"],#1,"eq","No")=1`|Warning|**Depends on**:

- MySQL: The {#REPLICA.KEY} I/O thread is not running
|

### LLD rule MariaDB discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|MariaDB discovery|
Used for additional metrics if MariaDB is used.
|Dependent item|mysql.extra_metric.discovery
**Preprocessing**

- 
JavaScript: `The text is too long. Please see the template.`

|

### Item prototypes for MariaDB discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Binlog commits|
Total number of transactions committed to the binary log.
|Dependent item|mysql.binlog_commits[{#SINGLETON}]
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Binlog_commits')].Value.first()`

|
|Binlog group commits|
Total number of group commits done to the binary log.
|Dependent item|mysql.binlog_group_commits[{#SINGLETON}]
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Binlog_group_commits')].Value.first()`

|
|Master GTID wait count|
The number of times `MASTER_GTID_WAIT` called.
|Dependent item|mysql.master_gtid_wait_count[{#SINGLETON}]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `6h`

|
|Master GTID wait time|
Total number of time spent in `MASTER_GTID_WAIT`.
|Dependent item|mysql.master_gtid_wait_time[{#SINGLETON}]
**Preprocessing**

- 
JSON Path: `$[?(@.Variable_name=='Master_gtid_wait_time')].Value.first()`

- 
Discard unchanged with heartbeat: `6h`

|
|Master GTID wait timeouts|
Number of timeouts occurring in `MASTER_GTID_WAIT`.
|Dependent item|mysql.master_gtid_wait_timeouts[{#SINGLETON}]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `6h`

|

## Feedback

Please report any issues with the template at [`https://support.zabbix.com`](https://support.zabbix.com)

You can also provide feedback, discuss the template, or ask for help at [`ZABBIX forums`](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback)

