MariaDB

MariaDB is a community-developed fork of MySQL, started by its original authors and released under the GPL. It ships as the default MySQL-compatible database in most Linux distributions, and adds storage engines of its own, the Galera synchronous cluster and the MaxScale proxy.

Dostupná řešení

Zabbix version 8.0
Download

MariaDB by Zabbix agent

Overview

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

Requirements

Zabbix version: 8.0 and higher.

Tested versions

This template has been tested on:

  • MariaDB 10.6, 11.8, 12.1.2, 12.3.2

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

  1. Install Zabbix agent and MariaDB client. If necessary, add the path to the 'mariadb' and 'mariadb-admin' utilities to the global environment variable PATH.
  2. Copy the template_db_mariadb.conf file with user parameters into folder with Zabbix agent configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget to restart Zabbix agent.
  3. Create the MariaDB user that will be used for monitoring (<password> at your discretion). For example:
CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';
GRANT SLAVE MONITOR, PROCESS, SHOW DATABASES, SHOW VIEW ON *.* TO 'zbx_monitor'@'%';

For more information, please see MariaDB documentation.

  1. Create .my.cnf configuration file in the home directory of Zabbix agent for Linux distributions (/var/lib/zabbix by default) or my.cnf in c:\ for Windows. For example:
[client]
protocol=tcp
user='zbx_monitor'
password='<password>'

For more information, please see MariaDB documentation.

NOTE: Linux distributions that use SELinux may require additional steps for access configuration.

For example, the following rule could be added to the SELinux policy:

# cat <<EOF > zabbix_home.te
module zabbix_home 1.0;

require {
        type zabbix_agent_t;
        type zabbix_var_lib_t;
        type mysqld_etc_t;
        type mysqld_port_t;
        type mysqld_var_run_t;
        class file { open read };
        class tcp_socket name_connect;
        class sock_file write;
}

#============= zabbix_agent_t ==============

allow zabbix_agent_t zabbix_var_lib_t:file read;
allow zabbix_agent_t zabbix_var_lib_t:file open;
allow zabbix_agent_t mysqld_etc_t:file read;
allow zabbix_agent_t mysqld_port_t:tcp_socket name_connect;
allow zabbix_agent_t mysqld_var_run_t:sock_file write;
EOF
# checkmodule -M -m -o zabbix_home.mod zabbix_home.te
# semodule_package -o zabbix_home.pp -m zabbix_home.mod
# semodule -i zabbix_home.pp
# restorecon -R /var/lib/zabbix

Optionally, it is possible to customize the template:

  • The discovery of tables is disabled by default. To enable table discovery, change the value of the macro {$MARIADB.TABLE.NAMES.MATCHES} to the name of a single table, or use a regex string to include multiple tables.
  • You can also add an additional context macro {$MARIADB.TABLE.NAMES.MATCHES:<dbname>} for specific databases to precisely control which tables should be discovered.
  • To exclude certain tables from discovery, change the value of the macro {$MARIADB.TABLE.NAMES.NOT_MATCHES} to the name of a single table, or use a regex string to exclude multiple tables.
  • You can also add an additional context macro {$MARIADB.TABLE.NAMES.NOT_MATCHES:<dbname>} for specific databases to precisely control which tables should be excluded.

Macros used

Name Description Default
{$MARIADB.HOST}

Hostname or IP of MariaDB host or container.

127.0.0.1
{$MARIADB.PORT}

MariaDB service port.

3306
{$MARIADB.ABORTED_CONN.MAX.WARN}

Number of failed attempts to connect to the MariaDB server for trigger expressions.

3
{$MARIADB.REPL_LAG.MAX.WARN}

Amount of time the replica is behind the source for trigger expressions.

30m
{$MARIADB.SLOW_QUERIES.MAX.WARN}

Number of slow queries for trigger expressions.

3
{$MARIADB.FULLSCAN.RATIO.WARN}

Warning threshold for full table scan ratio.

0.1
{$MARIADB.FULLSCAN.SELECT_RATE.MIN.WARN}

The minimum SELECT statement rate (per second) for trigger expressions.

5
{$MARIADB.BUFF_UTIL.MIN.WARN}

The minimum buffer pool utilization in percent for trigger expressions.

50
{$MARIADB.CREATED_TMP_TABLES.MAX.WARN}

The maximum number of temporary tables created in memory per second for trigger expressions.

30
{$MARIADB.CREATED_TMP_DISK_TABLES.MAX.WARN}

The maximum number of temporary tables created on a disk per second for trigger expressions.

10
{$MARIADB.CREATED_TMP_FILES.MAX.WARN}

The maximum number of temporary files created on a disk per second for trigger expressions.

10
{$MARIADB.INNODB_LOG_FILES}

Number of physical files in the InnoDB redo log for calculating innodb_log_file_size.

2
{$MARIADB.DBNAME.MATCHES}

Filter of discoverable databases.

.+
{$MARIADB.DBNAME.NOT_MATCHES}

Filter to exclude discovered databases.

information_schema|performance_schema|mariadb|sys
{$MARIADB.TABLE.NAMES.MATCHES}

Filter of discoverable tables. Use a context to change the filter of discoverable tables for a specific database.

CHANGE_IF_NEEDED
{$MARIADB.TABLE.NAMES.NOT_MATCHES}

Filter to exclude discovered tables. Use a context to change the filter to exclude discovered tables for a specific database.

CHANGE_IF_NEEDED
{$MARIADB.TOTALSIZE.GROWTH.MAX.WARN}

The warning threshold of the total table size growth for trigger expressions.

300M
{$MARIADB.TOTALSIZE.GROWTH.MAX.CRIT}

The critical threshold of the total table size growth for trigger expressions.

1G
{$MARIADB.FRAGMENTATION.WARN}

The free ratio threshold for warning fragmentation trigger expressions.

0.3
{$MARIADB.FRAGMENTATION.CRIT}

The free ratio threshold for critical fragmentation trigger expressions.

0.6
{$MARIADB.DATA_FREE.MIN.WARN}

The minimum Data_free value for warning fragmentation trigger expressions.

1G
{$MARIADB.DATA_FREE.MIN.CRIT}

The minimum Data_free value for critical fragmentation trigger expressions.

5G
{$MARIADB.TABLE_SIZE.MIN.WARN}

The minimum table size for warning fragmentation trigger expressions.

3G
{$MARIADB.TABLE_SIZE.MIN.CRIT}

The minimum table size for critical fragmentation trigger expressions.

10G

Items

Name Description Type Key and additional info
Get status variables

Gets server global status information.

Zabbix agent mariadb.get_status_variables["{$MARIADB.HOST}","{$MARIADB.PORT}"]
Status

MariaDB server status.

Zabbix agent mariadb.ping["{$MARIADB.HOST}","{$MARIADB.PORT}"]

Preprocessing

  • JavaScript: return value.indexOf('is alive') !== -1 ? 1 : 0;

  • Discard unchanged with heartbeat: 10m

Version

MariaDB server version.

Zabbix agent mariadb.version["{$MARIADB.HOST}","{$MARIADB.PORT}"]

Preprocessing

  • Regular expression: (Server version)\s+(.+) \2

  • Discard unchanged with heartbeat: 1d

Uptime

Number of seconds that the server has been up.

Dependent item mariadb.uptime

Preprocessing

  • XML XPath: The text is too long. Please see the template.

Aborted clients per second

Number of connections that were aborted because the client died without closing the connection properly.

Dependent item mariadb.aborted_clients.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Aborted connections per second

Number of failed attempts to connect to the MariaDB server.

Dependent item mariadb.aborted_connects.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Connection errors accept per second

Number of errors that occurred during calls to accept() on the listening port.

Dependent item mariadb.connection_errors_accept.rate

Preprocessing

  • XML XPath: 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 mariadb.connection_errors_internal.rate

Preprocessing

  • XML XPath: 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 mariadb.connection_errors_max_connections.rate

Preprocessing

  • XML XPath: 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 mariadb.connection_errors_peer_address.rate

Preprocessing

  • XML XPath: 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 mariadb.connection_errors_select.rate

Preprocessing

  • XML XPath: 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 mariadb.connection_errors_tcpwrap.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Connections per second

Number of connection attempts (successful or not) to the MariaDB server.

Dependent item mariadb.connections.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Max used connections

The maximum number of connections that have been in use simultaneously since the server start.

Dependent item mariadb.max_used_connections

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Threads cached

Number of threads in the thread cache.

Dependent item mariadb.threads_cached

Preprocessing

  • XML XPath: The text is too long. Please see the template.

Threads connected

Number of currently open connections.

Dependent item mariadb.threads_connected

Preprocessing

  • XML XPath: The text is too long. Please see the template.

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 mariadb.threads_created.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Threads running

Number of threads that are not sleeping.

Dependent item mariadb.threads_running

Preprocessing

  • XML XPath: The text is too long. Please see the template.

Buffer pool efficiency

Shows how effectively the buffer pool is serving reads.

Calculated mariadb.buffer_pool_efficiency
Buffer pool utilization

Ratio of used to total pages in the buffer pool.

Calculated mariadb.buffer_pool_utilization
Created tmp files on disk per second

How many temporary files mariadbd has created.

Dependent item mariadb.created_tmp_files.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.created_tmp_disk_tables.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Created tmp tables in memory per second

Number of internal temporary tables created by the server while executing statements.

Dependent item mariadb.created_tmp_tables.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
InnoDB buffer pool pages free

The number of free pages in the InnoDB buffer pool.

Dependent item mariadb.innodb_buffer_pool_pages_free

Preprocessing

  • XML XPath: 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 mariadb.innodb_buffer_pool_pages_total

Preprocessing

  • XML XPath: 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 mariadb.innodb_buffer_pool_read_requests

Preprocessing

  • XML XPath: 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 mariadb.innodb_buffer_pool_read_requests.rate

Preprocessing

  • XML XPath: 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 mariadb.innodb_buffer_pool_reads

Preprocessing

  • XML XPath: 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 mariadb.innodb_buffer_pool_reads.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
InnoDB log waits per second

Number of InnoDB log waits per second. An increase in this per-second value

indicates that threads are increasingly waiting for redo log writes, which typically

points to disk subsystem performance issues or an innodb_log_file_size that is too small.

Dependent item mariadb.innodb_log_waits.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

InnoDB row lock time

The total time spent in acquiring row locks for InnoDB tables.

Dependent item mariadb.innodb_row_lock_time

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Custom multiplier: 0.001

  • Discard unchanged with heartbeat: 1h

InnoDB row lock wait time avg

Average time spent waiting for row locks in InnoDB.

Dependent item mariadb.innodb_row_lock_time_avg

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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.

Dependent item mariadb.innodb_row_lock_time_max

Preprocessing

  • XML XPath: 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 mariadb.innodb_row_lock_waits

Preprocessing

  • XML XPath: The text is too long. Please see the template.

InnoDB row lock current waits

Current number of active row lock waits in InnoDB.

Dependent item mariadb.innodb_row_lock_current_waits

Preprocessing

  • XML XPath: The text is too long. Please see the template.

Slow queries per second

Number of queries that have taken more than long_query_time seconds.

Dependent item mariadb.slow_queries.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Bytes received

Number of bytes received from all clients.

Dependent item mariadb.bytes_received.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
Bytes sent

Number of bytes sent to all clients.

Dependent item mariadb.bytes_sent.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.com_delete.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.com_insert.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.com_select.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.com_update.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.queries.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.questions.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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 mariadb.binlog_cache_disk_use

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Select scan per second

The number of SELECT queries that required a full table scan. A high value indicates a lack of or improper use of indexes.

Dependent item mariadb.select_scan.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

Full table scan ratio

The ratio of SELECT statements executed as full table scans to all SELECT statements.

Calculated mariadb.full_scans.ratio

Preprocessing

  • Discard unchanged with heartbeat: 1h

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 number of waits for this operation to finish. If this value is not small, consider increasing innodb_buffer_pool_size.

Dependent item mariadb.innodb_buffer_pool_wait_free

Preprocessing

  • XML XPath: 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 mariadb.innodb_num_open_files

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Open table definitions

Number of cached table definitions.

Dependent item mariadb.open_table_definitions

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Open tables

Number of tables that are open.

Dependent item mariadb.open_tables

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

InnoDB log written

Number of bytes written to the InnoDB log.

Dependent item mariadb.innodb_os_log_written

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • 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))/{$MARIADB.INNODB_LOG_FILES}. Innodb_log_file_size is the size in bytes of 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 mariadb.innodb_log_file_size

Preprocessing

  • Discard unchanged with heartbeat: 6h

Binlog commits

Total number of transactions committed to the binary log.

Dependent item mariadb.binlog_commits

Preprocessing

  • XML XPath: The text is too long. Please see the template.

Binlog group commits

Total number of group commits done to the binary log.

Dependent item mariadb.binlog_group_commits

Preprocessing

  • XML XPath: The text is too long. Please see the template.

Master GTID wait count

The number of times MASTER_GTID_WAIT was called.

Dependent item mariadb.master_gtid_wait_count

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Master GTID wait time

Total time spent in MASTER_GTID_WAIT.

Dependent item mariadb.master_gtid_wait_time

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Master GTID wait timeouts

Number of timeouts occurring in MASTER_GTID_WAIT.

Dependent item mariadb.master_gtid_wait_timeouts

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 6h

Aria pagecache reads

Number of physical reads from disk to the Aria pagecache.

Dependent item mariadb.aria_pagecache_reads

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Aria pagecache reads per second

Number of physical reads from disk to the Aria pagecache per second.

Dependent item mariadb.aria_pagecache_reads.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

Aria pagecache read requests

Number of read requests issued to the Aria pagecache.

Dependent item mariadb.aria_pagecache_read_requests

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Aria pagecache read requests per second

Number of read requests issued to the Aria pagecache per second.

Dependent item mariadb.aria_pagecache_read_requests.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

Aria pagecache writes per second

Number of physical writes from Aria pagecache to disk per second.

Dependent item mariadb.aria_pagecache_writes.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

Aria pagecache write requests per second

Number of write requests issued to the Aria pagecache per second.

Dependent item mariadb.aria_pagecache_write_requests.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

Aria transaction log syncs per second

Number of Aria transaction log fsync operations per second.

Dependent item mariadb.aria_transaction_log_syncs.rate

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Change per second
  • Discard unchanged with heartbeat: 1h

Aria pagecache blocks not flushed

Number of Aria pagecache blocks that contain modified data and have not yet been flushed to disk.

Dependent item mariadb.aria_pagecache_blocks_not_flushed

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Aria pagecache blocks unused

Number of currently free blocks in the Aria pagecache buffer.

Dependent item mariadb.aria_pagecache_blocks_unused

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Aria pagecache blocks used

Number of blocks currently in use in the Aria pagecache buffer.

Dependent item mariadb.aria_pagecache_blocks_used

Preprocessing

  • XML XPath: The text is too long. Please see the template.

  • Discard unchanged with heartbeat: 1h

Aria pagecache hit rate

Percentage of Aria pagecache read requests served from cache (higher means fewer disk reads).

Calculated mariadb.aria_pagecache_hit_rate

Triggers

Name Description Expression Severity Dependencies and additional info
MariaDB: Service is unreachable

MariaDB is unreachable.

last(/MariaDB by Zabbix agent/mariadb.ping["{$MARIADB.HOST}","{$MARIADB.PORT}"])=0 High
MariaDB: Version has changed

The MariaDB version has changed. Acknowledge to close the problem manually.

last(/MariaDB by Zabbix agent/mariadb.version["{$MARIADB.HOST}","{$MARIADB.PORT}"],#1)<>last(/MariaDB by Zabbix agent/mariadb.version["{$MARIADB.HOST}","{$MARIADB.PORT}"],#2) and length(last(/MariaDB by Zabbix agent/mariadb.version["{$MARIADB.HOST}","{$MARIADB.PORT}"]))>0 Info Manual close: Yes
MariaDB: Service has been restarted

MariaDB uptime is less than 10 minutes.

last(/MariaDB by Zabbix agent/mariadb.uptime)<10m Info
MariaDB: Failed to fetch data

Zabbix has not received any data for the last 30 minutes.

nodata(/MariaDB by Zabbix agent/mariadb.uptime,30m)=1 Info Depends on:
  • MariaDB: Service is unreachable
MariaDB: Server has aborted connections

The number of failed attempts to connect to the MariaDB server has been more than {$MARIADB.ABORTED_CONN.MAX.WARN} in the last 5 minutes.

min(/MariaDB by Zabbix agent/mariadb.aborted_connects.rate,5m)>{$MARIADB.ABORTED_CONN.MAX.WARN} Average Depends on:
  • MariaDB: Refused connections
MariaDB: Refused connections

Number of refused connections due to the max_connections limit being reached.

last(/MariaDB by Zabbix agent/mariadb.connection_errors_max_connections.rate)>0 Average
MariaDB: Buffer pool utilization is too low

The buffer pool utilization has been less than {$MARIADB.BUFF_UTIL.MIN.WARN}% in the last 5 minutes with server uptime over 1 hour. This means that there is a lot of unused RAM allocated for the buffer pool, which you can easily reallocate at the moment.

max(/MariaDB by Zabbix agent/mariadb.buffer_pool_utilization,5m)<{$MARIADB.BUFF_UTIL.MIN.WARN} and last(/MariaDB by Zabbix agent/mariadb.uptime)>3600 Warning
MariaDB: Number of temporary files created per second is high

The application using the database may be in need of query optimization.

min(/MariaDB by Zabbix agent/mariadb.created_tmp_files.rate,5m)>{$MARIADB.CREATED_TMP_FILES.MAX.WARN} Warning
MariaDB: Number of on-disk temporary tables created per second is high

The application using the database may be in need of query optimization.

min(/MariaDB by Zabbix agent/mariadb.created_tmp_disk_tables.rate,5m)>{$MARIADB.CREATED_TMP_DISK_TABLES.MAX.WARN} Warning
MariaDB: Number of internal temporary tables created per second is high

The application using the database may be in need of query optimization.

min(/MariaDB by Zabbix agent/mariadb.created_tmp_tables.rate,5m)>{$MARIADB.CREATED_TMP_TABLES.MAX.WARN} Warning
MariaDB: Server has slow queries

The number of slow queries has been more than {$MARIADB.SLOW_QUERIES.MAX.WARN} in the last 5 minutes.

min(/MariaDB by Zabbix agent/mariadb.slow_queries.rate,5m)>{$MARIADB.SLOW_QUERIES.MAX.WARN} Warning
MariaDB: High rate of full table scans

The rate of SELECT statements exceeds {$MARIADB.FULLSCAN.SELECT_RATE.MIN.WARN} per second and the full table scan ratio has been above {$MARIADB.FULLSCAN.RATIO.WARN} for the last 5 minutes.

avg(/MariaDB by Zabbix agent/mariadb.full_scans.ratio,5m)>{$MARIADB.FULLSCAN.RATIO.WARN} and avg(/MariaDB by Zabbix agent/mariadb.com_select.rate,5m)>{$MARIADB.FULLSCAN.SELECT_RATE.MIN.WARN} Warning

LLD rule Database discovery

Name Description Type Key and additional info
Database discovery

Used for the discovery of databases.

Zabbix agent mariadb.db.discovery["{$MARIADB.HOST}","{$MARIADB.PORT}"]

Preprocessing

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

  • Discard unchanged with heartbeat: 1d

Item prototypes for Database discovery

Name Description Type Key and additional info
Database [{#DBNAME}]: Size

Database size.

Zabbix agent mariadb.dbsize["{$MARIADB.HOST}","{$MARIADB.PORT}","{#DBNAME}"]

Preprocessing

  • Discard unchanged with heartbeat: 1h

LLD rule Database [{#DBNAME}]: Table discovery

Name Description Type Key and additional info
Database [{#DBNAME}]: Table discovery

Used for the discovery of tables of the databases.

Zabbix agent mariadb.table.discovery["{$MARIADB.HOST}","{$MARIADB.PORT}","{#DBNAME}"]

Preprocessing

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

  • Discard unchanged with heartbeat: 1d

Item prototypes for Database [{#DBNAME}]: Table discovery

Name Description Type Key and additional info
Table [{#DBNAME}/{#TABLE_NAME}]: Get data

Database table data.

Zabbix agent mariadb.tabledata["{$MARIADB.HOST}","{$MARIADB.PORT}","{#DBNAME}","{#TABLE_NAME}"]
Table [{#DBNAME}/{#TABLE_NAME}]: Data length

The size of the data in the table.

Dependent item mariadb.table.data_length["{#DBNAME}","{#TABLE_NAME}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='DATA_LENGTH']/text()

  • Custom multiplier: 1

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Table [{#DBNAME}/{#TABLE_NAME}]: Index length

The size occupied by the table's indexes.

Dependent item mariadb.table.index_length["{#DBNAME}","{#TABLE_NAME}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='INDEX_LENGTH']/text()

  • Custom multiplier: 1

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Table [{#DBNAME}/{#TABLE_NAME}]: Total size

The sum of DATA_LENGTH and INDEX_LENGTH represents the total size of the table.

Calculated mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"]

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Table [{#DBNAME}/{#TABLE_NAME}]: Data free

The amount of unused but allocated space.

Dependent item mariadb.table.data_free["{#DBNAME}","{#TABLE_NAME}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='DATA_FREE']/text()

  • Custom multiplier: 1

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Table [{#DBNAME}/{#TABLE_NAME}]: Free ratio

The fraction of allocated table space that is currently unused (DATA_FREE / (DATA_LENGTH + INDEX_LENGTH)).

High values indicate potential table fragmentation or inefficient space usage.

Calculated mariadb.table.free_ratio["{#DBNAME}","{#TABLE_NAME}"]

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Table [{#DBNAME}/{#TABLE_NAME}]: Rows

The approximate number of rows in the table. For InnoDB, the TABLE_ROWS value is approximate and may differ from the actual count.

Dependent item mariadb.table.rows["{#DBNAME}","{#TABLE_NAME}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='TABLE_ROWS']/text()

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

  • Discard unchanged with heartbeat: 1h

Trigger prototypes for Database [{#DBNAME}]: Table discovery

Name Description Expression Severity Dependencies and additional info
MariaDB: Table [{#DBNAME}/{#TABLE_NAME}]: Total size growth is too high

Total table size growth is too high.

(last(/MariaDB by Zabbix agent/mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"])-min(/MariaDB by Zabbix agent/mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"],5m))>{$MARIADB.TOTALSIZE.GROWTH.MAX.CRIT} High
MariaDB: Table [{#DBNAME}/{#TABLE_NAME}]: Total size growth is high

Total table size growth is high.

(last(/MariaDB by Zabbix agent/mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"])-min(/MariaDB by Zabbix agent/mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"],5m))>{$MARIADB.TOTALSIZE.GROWTH.MAX.WARN} Warning Depends on:
  • MariaDB: Table [{#DBNAME}/{#TABLE_NAME}]: Total size growth is too high
MariaDB: Table [{#DBNAME}/{#TABLE_NAME}]: Free space very high

Free table space is very high (fragmentation critical).

last(/MariaDB by Zabbix agent/mariadb.table.free_ratio["{#DBNAME}","{#TABLE_NAME}"]) > {$MARIADB.FRAGMENTATION.CRIT} and last(/MariaDB by Zabbix agent/mariadb.table.data_free["{#DBNAME}","{#TABLE_NAME}"]) > {$MARIADB.DATA_FREE.MIN.CRIT} and last(/MariaDB by Zabbix agent/mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"]) > {$MARIADB.TABLE_SIZE.MIN.CRIT} High
MariaDB: Table [{#DBNAME}/{#TABLE_NAME}]: Free space high

Free table space is high (fragmentation warning).

last(/MariaDB by Zabbix agent/mariadb.table.free_ratio["{#DBNAME}","{#TABLE_NAME}"]) > {$MARIADB.FRAGMENTATION.WARN} and last(/MariaDB by Zabbix agent/mariadb.table.data_free["{#DBNAME}","{#TABLE_NAME}"]) > {$MARIADB.DATA_FREE.MIN.WARN} and last(/MariaDB by Zabbix agent/mariadb.table.total_size["{#DBNAME}","{#TABLE_NAME}"]) > {$MARIADB.TABLE_SIZE.MIN.WARN} Warning Depends on:
  • MariaDB: Table [{#DBNAME}/{#TABLE_NAME}]: Free space very high

LLD rule Replication discovery

Name Description Type Key and additional info
Replication discovery

Discovery of the replication.

Zabbix agent mariadb.replication.discovery["{$MARIADB.HOST}","{$MARIADB.PORT}"]

Preprocessing

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

  • Discard unchanged with heartbeat: 1d

Item prototypes for Replication discovery

Name Description Type Key and additional info
Replication: Replica status {#MASTER_HOST}

Gets status information on the essential parameters of the replica threads.

Zabbix agent mariadb.slave_status["{$MARIADB.HOST}","{$MARIADB.PORT}","{#SQL_STATEMENT}"]

Preprocessing

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

Replication: Replica SQL running state {#MASTER_HOST}

Shows the state of the SQL thread.

Dependent item mariadb.slave_sql_running_state["{#MASTER_HOST}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='Slave_SQL_Running_State']/text()

  • Discard unchanged with heartbeat: 6h

Replication: Seconds behind source {#MASTER_HOST}

The number of seconds the replica SQL thread has been behind processing the source binary log.

A high number (or an increasing one) can indicate that the replica is unable to handle events

from the source in a timely fashion.

Dependent item mariadb.seconds_behind_master["{#MASTER_HOST}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='Seconds_Behind_Master']/text()

  • Discard unchanged with heartbeat: 1h

  • Matches regular expression: \d+

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

Replication: Replica IO running {#MASTER_HOST}

Indicates whether the I/O thread for reading the source'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.

Dependent item mariadb.slave_io_running["{#MASTER_HOST}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='Slave_IO_Running']/text()

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

  • Discard unchanged with heartbeat: 1h

Replication: Replica SQL running {#MASTER_HOST}

Indicates 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 mariadb.slave_sql_running["{#MASTER_HOST}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='Slave_SQL_Running']/text()

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

  • Discard unchanged with heartbeat: 1h

Replication: Last IO error {#MASTER_HOST}

Describes the last I/O error message reported by the replica I/O thread that caused replication to stop or behave incorrectly.

Dependent item mariadb.slave_io_error["{#MASTER_HOST}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='Last_IO_Error']/text()

  • Discard unchanged with heartbeat: 6h

Replication: Last SQL error {#MASTER_HOST}

Describes the last SQL error message reported by the replica SQL thread that caused replication to stop or behave incorrectly.

Dependent item mariadb.slave_sql_error["{#MASTER_HOST}"]

Preprocessing

  • XML XPath: /resultset/row/field[@name='Last_SQL_Error']/text()

  • Discard unchanged with heartbeat: 6h

Trigger prototypes for Replication discovery

Name Description Expression Severity Dependencies and additional info
MariaDB: Replication lag is too high

Replication delay is too long.

min(/MariaDB by Zabbix agent/mariadb.seconds_behind_master["{#MASTER_HOST}"],5m)>{$MARIADB.REPL_LAG.MAX.WARN} Warning
MariaDB: The replica I/O thread is not running

Indicates whether the I/O thread for reading the source's binary log is running.

last(/MariaDB by Zabbix agent/mariadb.slave_io_running["{#MASTER_HOST}"])=2 Average
MariaDB: The replica I/O thread is not connected to a replication source

Indicates whether the replica I/O thread is connected to the source.

last(/MariaDB by Zabbix agent/mariadb.slave_io_running["{#MASTER_HOST}"])<>1 Warning Depends on:
  • MariaDB: The replica I/O thread is not running
MariaDB: The SQL thread is not running

Indicates whether the SQL thread for executing events in the relay log is running.

last(/MariaDB by Zabbix agent/mariadb.slave_sql_running["{#MASTER_HOST}"])=2 Warning Depends on:
  • MariaDB: The replica I/O thread is not running

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

Články a dokumentace

+ Navrhněte nový článek

Nenašli jste integraci, kterou potřebujete?