Files
templates-default/MySQL_by_Zabbix_agent_2_active.yaml
T

1612 lines
66 KiB
YAML

zabbix_export:
version: '7.0'
template_groups:
- uuid: 748ad4d098d447d492bb935c907f652f
name: Templates/Databases
templates:
- uuid: 51ffd432b9324ce2b04e1d4dc4122d16
template: 'MySQL by Zabbix agent 2 active'
name: 'MySQL by Zabbix agent 2 active'
description: |
Requirements for template operation:
1. Create a MySQL user for monitoring. For example:
CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';
GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
For more information please read the 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:
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 in the {$MYSQL.DSN} macro the data source name of the MySQL instance either session name from Zabbix agent 2 configuration file or URI.
Examples: MySQL1, tcp://localhost:3306, tcp://172.16.0.10, unix:/var/run/mysql.sock
For more information about MySQL Unix socket file please read the MySQL documentation https://dev.mysql.com/doc/refman/8.0/en/problems-with-mysql-sock.html.
3. If you had set URI in the {$MYSQL.DSN}, please define the user name and password in host macros ({$MYSQL.USER} and {$MYSQL.PASSWORD}).
Leave macros {$MYSQL.USER} and {$MYSQL.PASSWORD} empty if you use a session name. Set the user name and password in the Plugins.Mysql.<...> section of your Zabbix agent 2 configuration file.
For more information about configuring the Zabbix MySQL plugin please read the documentation https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/src/go/plugins/mysql/README.md.
NOTE: In order to use this template for monitoring MySQL version 8.4 and later, Zabbix agent 2 version 7.0.22 and later should be used.
You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384189-discussion-thread-for-official-zabbix-template-db-mysql.
Generated by official Zabbix template tool "Templator"
vendor:
name: Zabbix
version: 7.0-6
groups:
- name: Templates/Databases
items:
- uuid: 2c14889cb9c7426390652828687551a9
name: 'Aborted clients per second'
type: DEPENDENT
key: mysql.aborted_clients.rate
delay: '0'
value_type: FLOAT
description: 'Number of connections that were aborted because the client died without closing the connection properly.'
preprocessing:
- type: JSONPATH
parameters:
- $.Aborted_clients
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 038a2fd010bb45e18217a69c2af1607f
name: 'Aborted connections per second'
type: DEPENDENT
key: mysql.aborted_connects.rate
delay: '0'
value_type: FLOAT
description: 'Number of failed attempts to connect to the MySQL server.'
preprocessing:
- type: JSONPATH
parameters:
- $.Aborted_connects
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
triggers:
- uuid: a8dbc39812ea4ce488dab64ee230c38c
expression: 'min(/MySQL by Zabbix agent 2 active/mysql.aborted_connects.rate,5m)>{$MYSQL.ABORTED_CONN.MAX.WARN}'
name: 'MySQL: Server has aborted connections'
event_name: 'MySQL: Server has aborted connections (over {$MYSQL.ABORTED_CONN.MAX.WARN} for 5m)'
priority: AVERAGE
description: 'The number of failed attempts to connect to the MySQL server is more than `{$MYSQL.ABORTED_CONN.MAX.WARN}` in the last 5 minutes.'
dependencies:
- name: 'MySQL: Refused connections'
expression: 'last(/MySQL by Zabbix agent 2 active/mysql.connection_errors_max_connections.rate)>0'
tags:
- tag: scope
value: availability
- uuid: ae06d3e7db1d4a8fb85cc65a3dc5e355
name: 'Binlog cache disk use'
type: DEPENDENT
key: mysql.binlog_cache_disk_use
delay: '0'
value_type: FLOAT
description: '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`.'
preprocessing:
- type: JSONPATH
parameters:
- $.Binlog_cache_disk_use
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: cache
- uuid: 82d31eef03914d4abde2448691d89a7a
name: 'Buffer pool efficiency'
type: CALCULATED
key: mysql.buffer_pool_efficiency
value_type: FLOAT
units: '%'
params: |
100 - (last(//mysql.innodb_buffer_pool_reads) /
( last(//mysql.innodb_buffer_pool_read_requests) +
( last(//mysql.innodb_buffer_pool_read_requests) = 0 ) ) * 100 *
( last(//mysql.innodb_buffer_pool_read_requests) > 0 ))
description: 'The item shows how effectively the buffer pool is serving reads.'
tags:
- tag: component
value: memory
- uuid: 9fa2d2ebecaa4ff4bf2ec01a68cdf2a2
name: 'Buffer pool utilization'
type: CALCULATED
key: mysql.buffer_pool_utilization
value_type: FLOAT
units: '%'
params: |
( last(//mysql.innodb_buffer_pool_pages_total) -
last(//mysql.innodb_buffer_pool_pages_free) ) /
( last(//mysql.innodb_buffer_pool_pages_total) +
( last(//mysql.innodb_buffer_pool_pages_total) = 0 ) ) * 100 *
( last(//mysql.innodb_buffer_pool_pages_total) > 0 )
description: 'Ratio of used to total pages in the buffer pool.'
tags:
- tag: component
value: memory
triggers:
- uuid: 69e652db80c145e4bf7a4d4e99e0cb35
expression: 'max(/MySQL by Zabbix agent 2 active/mysql.buffer_pool_utilization,5m)<{$MYSQL.BUFF_UTIL.MIN.WARN}'
name: 'MySQL: Buffer pool utilization is too low'
event_name: 'MySQL: Buffer pool utilization is too low (less than {$MYSQL.BUFF_UTIL.MIN.WARN}% for 5m)'
priority: WARNING
description: '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.'
tags:
- tag: scope
value: notice
- uuid: 632dbd84e6844ed397cf1b3ffc107960
name: 'Bytes received'
type: DEPENDENT
key: mysql.bytes_received.rate
delay: '0'
value_type: FLOAT
units: Bps
description: 'Number of bytes received from all clients.'
preprocessing:
- type: JSONPATH
parameters:
- $.Bytes_received
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: network
- uuid: 7ffc513ae6994a1aa5a3ed7f601255df
name: 'Bytes sent'
type: DEPENDENT
key: mysql.bytes_sent.rate
delay: '0'
value_type: FLOAT
units: Bps
description: 'Number of bytes sent to all clients.'
preprocessing:
- type: JSONPATH
parameters:
- $.Bytes_sent
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: network
- uuid: 64a7029760b94798a48333c456325059
name: 'Command Delete per second'
type: DEPENDENT
key: mysql.com_delete.rate
delay: '0'
value_type: FLOAT
description: 'The `Com_delete` counter variable indicates the number of times the `DELETE` statement has been executed.'
preprocessing:
- type: JSONPATH
parameters:
- $.Com_delete
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: operations
- uuid: a8c673bc3339494186bf53bf566c6b48
name: 'Command Insert per second'
type: DEPENDENT
key: mysql.com_insert.rate
delay: '0'
value_type: FLOAT
description: 'The `Com_insert` counter variable indicates the number of times the `INSERT` statement has been executed.'
preprocessing:
- type: JSONPATH
parameters:
- $.Com_insert
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: operations
- uuid: 5bbebf6e13c0428f89a599f4ff8110bf
name: 'Command Select per second'
type: DEPENDENT
key: mysql.com_select.rate
delay: '0'
value_type: FLOAT
description: 'The `Com_select` counter variable indicates the number of times the `SELECT` statement has been executed.'
preprocessing:
- type: JSONPATH
parameters:
- $.Com_select
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: operations
- uuid: c681dee803994e6790a7cee1400be6eb
name: 'Command Update per second'
type: DEPENDENT
key: mysql.com_update.rate
delay: '0'
value_type: FLOAT
description: 'The `Com_update` counter variable indicates the number of times the `UPDATE` statement has been executed.'
preprocessing:
- type: JSONPATH
parameters:
- $.Com_update
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: operations
- uuid: 7bad2c745fd44b2e8791ee134febf51f
name: 'Connections per second'
type: DEPENDENT
key: mysql.connections.rate
delay: '0'
value_type: FLOAT
description: 'Number of connection attempts (successful or not) to the MySQL server.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connections
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 79fc34a7b0c0468c9b9848684ce8a91c
name: 'Connection errors accept per second'
type: DEPENDENT
key: mysql.connection_errors_accept.rate
delay: '0'
value_type: FLOAT
description: 'Number of errors that occurred during calls to `accept()` on the listening port.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connection_errors_accept
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 7906ad745983463188ed4559d134c144
name: 'Connection errors internal per second'
type: DEPENDENT
key: mysql.connection_errors_internal.rate
delay: '0'
value_type: FLOAT
description: 'Number of refused connections due to internal server errors, for example, out of memory errors, or failed thread starts.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connection_errors_internal
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 0280f2ad4fa84c408540492ef560b626
name: 'Connection errors max connections per second'
type: DEPENDENT
key: mysql.connection_errors_max_connections.rate
delay: '0'
value_type: FLOAT
description: 'Number of refused connections due to the `max_connections` limit being reached.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connection_errors_max_connections
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
triggers:
- uuid: 4f4cdc4d19624598aaa68d18e13a45e4
expression: 'last(/MySQL by Zabbix agent 2 active/mysql.connection_errors_max_connections.rate)>0'
name: 'MySQL: Refused connections'
event_name: 'MySQL: Refused connections (max_connections limit reached)'
priority: AVERAGE
description: 'Number of refused connections due to the `max_connections` limit being reached.'
tags:
- tag: scope
value: availability
- uuid: a5140bb668234a048db647e4463f040c
name: 'Connection errors peer address per second'
type: DEPENDENT
key: mysql.connection_errors_peer_address.rate
delay: '0'
value_type: FLOAT
description: 'Number of errors while searching for the connecting client''s IP address.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connection_errors_peer_address
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 99dcacb6e1b4443faacd3b1a5330d240
name: 'Connection errors select per second'
type: DEPENDENT
key: mysql.connection_errors_select.rate
delay: '0'
value_type: FLOAT
description: 'Number of errors during calls to `select()` or `poll()` on the listening port. The client would not necessarily have been rejected in these cases.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connection_errors_select
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: a6901afc9c0047f18f05e4a2bdbdea4e
name: 'Connection errors tcpwrap per second'
type: DEPENDENT
key: mysql.connection_errors_tcpwrap.rate
delay: '0'
value_type: FLOAT
description: 'Number of connections the libwrap library has refused.'
preprocessing:
- type: JSONPATH
parameters:
- $.Connection_errors_tcpwrap
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 59efa8c9e8914cbda8d6e02706ef9972
name: 'Created tmp tables on disk per second'
type: DEPENDENT
key: mysql.created_tmp_disk_tables.rate
delay: '0'
value_type: FLOAT
description: 'Number of internal on-disk temporary tables created by the server while executing statements.'
preprocessing:
- type: JSONPATH
parameters:
- $.Created_tmp_disk_tables
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: storage
- tag: component
value: tables
triggers:
- uuid: cc8af7c9017a4873a037b5a0a8f7ac5f
expression: 'min(/MySQL by Zabbix agent 2 active/mysql.created_tmp_disk_tables.rate,5m)>{$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN}'
name: 'MySQL: Number of on-disk temporary tables created per second is high'
event_name: 'MySQL: Number of on-disk temporary tables created per second is high (over {$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN} for 5m)'
priority: WARNING
description: 'The application using the database may be in need of query optimization.'
tags:
- tag: scope
value: performance
- uuid: f1a3a596911b49a8b8bf6f36dc375c41
name: 'Created tmp files on disk per second'
type: DEPENDENT
key: mysql.created_tmp_files.rate
delay: '0'
value_type: FLOAT
description: 'How many temporary files `mysqld` has created.'
preprocessing:
- type: JSONPATH
parameters:
- $.Created_tmp_files
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: storage
triggers:
- uuid: 92ef67f27f384dd899ddb2865e00273a
expression: 'min(/MySQL by Zabbix agent 2 active/mysql.created_tmp_files.rate,5m)>{$MYSQL.CREATED_TMP_FILES.MAX.WARN}'
name: 'MySQL: Number of temporary files created per second is high'
event_name: 'MySQL: Number of temporary files created per second is high (over {$MYSQL.CREATED_TMP_FILES.MAX.WARN} for 5m)'
priority: WARNING
description: 'The application using the database may be in need of query optimization.'
tags:
- tag: scope
value: performance
- uuid: 8d67d3f53b794179a025f0813f766199
name: 'Created tmp tables on memory per second'
type: DEPENDENT
key: mysql.created_tmp_tables.rate
delay: '0'
value_type: FLOAT
description: 'Number of internal temporary tables created by the server while executing statements.'
preprocessing:
- type: JSONPATH
parameters:
- $.Created_tmp_tables
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: memory
- tag: component
value: tables
triggers:
- uuid: 1d927f1cbb3b4105accbaef3f0994f81
expression: 'min(/MySQL by Zabbix agent 2 active/mysql.created_tmp_tables.rate,5m)>{$MYSQL.CREATED_TMP_TABLES.MAX.WARN}'
name: 'MySQL: Number of internal temporary tables created per second is high'
event_name: 'MySQL: Number of internal temporary tables created per second is high (over {$MYSQL.CREATED_TMP_TABLES.MAX.WARN} for 5m)'
priority: WARNING
description: 'The application using the database may be in need of query optimization.'
tags:
- tag: scope
value: performance
- uuid: b942938fd6564e3cbcc37c11f59b2bed
name: 'Get status variables'
type: ZABBIX_ACTIVE
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
history: '0'
value_type: TEXT
trends: '0'
description: 'Gets server global status information.'
tags:
- tag: component
value: raw
- uuid: b0cf7faaf9e940abb7648c712963fc9e
name: 'InnoDB buffer pool pages free'
type: DEPENDENT
key: mysql.innodb_buffer_pool_pages_free
delay: '0'
description: 'The total size of the InnoDB buffer pool, in pages.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_pages_free
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: d1f7a0c2bb584d67b49dc963885d1bbb
name: 'InnoDB buffer pool pages total'
type: DEPENDENT
key: mysql.innodb_buffer_pool_pages_total
delay: '0'
description: 'The total size of the InnoDB buffer pool, in pages.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_pages_total
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: 96687092654a4d8b9e06e81664d89c12
name: 'InnoDB buffer pool reads'
type: DEPENDENT
key: mysql.innodb_buffer_pool_reads
delay: '0'
description: 'Number of logical reads that InnoDB could not satisfy from the buffer pool and had to read directly from the disk.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_reads
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: fddcc5c8139241c8ba8b950ec4cf6b1c
name: 'InnoDB buffer pool reads per second'
type: DEPENDENT
key: mysql.innodb_buffer_pool_reads.rate
delay: '0'
value_type: FLOAT
description: 'Number of logical reads per second that InnoDB could not satisfy from the buffer pool and had to read directly from the disk.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_reads
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: 53f1325ca0804cee8c4dff0b0064e54a
name: 'InnoDB buffer pool read requests'
type: DEPENDENT
key: mysql.innodb_buffer_pool_read_requests
delay: '0'
description: 'Number of logical read requests.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_read_requests
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: 946215157bce49e388eede72c9f89c57
name: 'InnoDB buffer pool read requests per second'
type: DEPENDENT
key: mysql.innodb_buffer_pool_read_requests.rate
delay: '0'
value_type: FLOAT
description: 'Number of logical read requests per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_read_requests
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: f2962ff518834cc69c56f99f4387a6cb
name: 'Innodb buffer pool wait free'
type: DEPENDENT
key: mysql.innodb_buffer_pool_wait_free
delay: '0'
value_type: FLOAT
description: '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`.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_buffer_pool_wait_free
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: memory
- uuid: c9e2183fde7d4fff96bd837c362c43e6
name: 'Calculated value of innodb_log_file_size'
type: CALCULATED
key: mysql.innodb_log_file_size
value_type: FLOAT
params: '(last(//mysql.innodb_os_log_written) - last(//mysql.innodb_os_log_written,#1:now-1h)) / {$MYSQL.INNODB_LOG_FILES}'
description: '`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.'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
tags:
- tag: component
value: system
- uuid: 2f3c759f069c47a5bb7dd20f11d94cd4
name: 'Innodb number open files'
type: DEPENDENT
key: mysql.innodb_num_open_files
delay: '0'
value_type: FLOAT
description: 'Number of open files held by InnoDB. InnoDB only.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_num_open_files
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: system
- uuid: a94b8d6e84254ac98141a5f173ca5ecc
name: 'Innodb log written'
type: DEPENDENT
key: mysql.innodb_os_log_written
delay: '0'
value_type: FLOAT
units: B
description: 'Number of bytes written to the InnoDB log.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_os_log_written
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: system
- uuid: 5b9c6129929b4d20b2f761709b8dc1a5
name: 'InnoDB row lock time'
type: DEPENDENT
key: mysql.innodb_row_lock_time
delay: '0'
value_type: FLOAT
units: s
description: 'The total time spent in acquiring row locks for InnoDB tables, in milliseconds.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_row_lock_time
- type: MULTIPLIER
parameters:
- '0.001'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: tables
- uuid: 75ee06905e604bdb94f168fa208dfb66
name: 'InnoDB row lock time max'
type: DEPENDENT
key: mysql.innodb_row_lock_time_max
delay: '0'
value_type: FLOAT
units: s
description: 'The maximum time to acquire a row lock for InnoDB tables, in milliseconds.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_row_lock_time_max
- type: MULTIPLIER
parameters:
- '0.001'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: tables
- uuid: 6c9472c9970641a2b1a6749e0a70b859
name: 'InnoDB row lock waits'
type: DEPENDENT
key: mysql.innodb_row_lock_waits
delay: '0'
description: 'Number of times operations on InnoDB tables had to wait for a row lock.'
preprocessing:
- type: JSONPATH
parameters:
- $.Innodb_row_lock_waits
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: innodb
- tag: component
value: tables
- uuid: 297d5be6f5054d00b91648cfb94ea186
name: 'Max used connections'
type: DEPENDENT
key: mysql.max_used_connections
delay: '0'
description: 'The maximum number of connections that have been in use simultaneously since the server start.'
preprocessing:
- type: JSONPATH
parameters:
- $.Max_used_connections
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: connections
- uuid: 61a666fbb3eb489685c27c94c20c58ae
name: 'Open tables'
type: DEPENDENT
key: mysql.open_tables
delay: '0'
value_type: FLOAT
description: 'Number of tables that are open.'
preprocessing:
- type: JSONPATH
parameters:
- $.Open_tables
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: tables
- uuid: baf1e71d09aa4f13a5426803406de58d
name: 'Open table definitions'
type: DEPENDENT
key: mysql.open_table_definitions
delay: '0'
value_type: FLOAT
description: 'Number of cached table definitions.'
preprocessing:
- type: JSONPATH
parameters:
- $.Open_table_definitions
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: tables
- uuid: 338507e500574423915f798234c7f239
name: Status
type: ZABBIX_ACTIVE
key: 'mysql.ping["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
description: 'MySQL server status.'
valuemap:
name: 'Service state'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 10m
tags:
- tag: component
value: application
- tag: component
value: health
triggers:
- uuid: 6fed4cabb4b349cd9a0f7e82e7706139
expression: 'last(/MySQL by Zabbix agent 2 active/mysql.ping["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"])=0'
name: 'MySQL: Service is down'
priority: HIGH
description: 'MySQL is down.'
tags:
- tag: scope
value: availability
- uuid: 4cc293c5b36a430694665f879fea7a21
name: 'Queries per second'
type: DEPENDENT
key: mysql.queries.rate
delay: '0'
value_type: FLOAT
description: 'Number of statements executed by the server. This variable includes statements executed within stored programs, unlike the `Questions` variable.'
preprocessing:
- type: JSONPATH
parameters:
- $.Queries
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: queries
- uuid: 218105acd6fd473b958c02adf8329d6a
name: 'Questions per second'
type: DEPENDENT
key: mysql.questions.rate
delay: '0'
value_type: FLOAT
description: '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.'
preprocessing:
- type: JSONPATH
parameters:
- $.Questions
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: queries
- uuid: 4c9f5e35a2e44265bd75b1268ee1cafb
name: 'Slow queries per second'
type: DEPENDENT
key: mysql.slow_queries.rate
delay: '0'
value_type: FLOAT
description: 'Number of queries that have taken more than `long_query_time` seconds.'
preprocessing:
- type: JSONPATH
parameters:
- $.Slow_queries
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: queries
triggers:
- uuid: 28b12490a27641ce828ec4d2e80f81b6
expression: 'min(/MySQL by Zabbix agent 2 active/mysql.slow_queries.rate,5m)>{$MYSQL.SLOW_QUERIES.MAX.WARN}'
name: 'MySQL: Server has slow queries'
event_name: 'MySQL: Server has slow queries (over {$MYSQL.SLOW_QUERIES.MAX.WARN} for 5m)'
priority: WARNING
description: 'The number of slow queries is more than `{$MYSQL.SLOW_QUERIES.MAX.WARN}` in the last 5 minutes.'
tags:
- tag: scope
value: performance
- uuid: 6706352c0746437ab99b9b9b660b931d
name: 'Threads cached'
type: DEPENDENT
key: mysql.threads_cached
delay: '0'
description: 'Number of threads in the thread cache.'
preprocessing:
- type: JSONPATH
parameters:
- $.Threads_cached
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: threads
- uuid: 0fecd4e46e274ceb9aaddb10534cc8ff
name: 'Threads connected'
type: DEPENDENT
key: mysql.threads_connected
delay: '0'
description: 'Number of currently open connections.'
preprocessing:
- type: JSONPATH
parameters:
- $.Threads_connected
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: threads
- uuid: 39ebfa8d6dde4ed9a8b53bb166d9b65c
name: 'Threads created per second'
type: DEPENDENT
key: mysql.threads_created.rate
delay: '0'
value_type: FLOAT
description: '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`.'
preprocessing:
- type: JSONPATH
parameters:
- $.Threads_created
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: threads
- uuid: a02ba173427b47f2a01ee456257db5e4
name: 'Threads running'
type: DEPENDENT
key: mysql.threads_running
delay: '0'
description: 'Number of threads that are not sleeping.'
preprocessing:
- type: JSONPATH
parameters:
- $.Threads_running
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: threads
- uuid: 051ba64b0da0464c866f8e0fd84cfe2d
name: Uptime
type: DEPENDENT
key: mysql.uptime
delay: '0'
units: uptime
description: 'Number of seconds that the server has been up.'
preprocessing:
- type: JSONPATH
parameters:
- $.Uptime
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: application
triggers:
- uuid: 3449a131f65d44c487a3346529713dd2
expression: 'nodata(/MySQL by Zabbix agent 2 active/mysql.uptime,30m)=1'
name: 'MySQL: Failed to fetch info data'
event_name: 'MySQL: Failed to fetch info data (or no data for 30m)'
priority: INFO
description: 'Zabbix has not received any data for items for the last 30 minutes.'
dependencies:
- name: 'MySQL: Service is down'
expression: 'last(/MySQL by Zabbix agent 2 active/mysql.ping["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"])=0'
tags:
- tag: scope
value: availability
- uuid: f92226addbf14463aea5aedc4f7bf7d8
expression: 'last(/MySQL by Zabbix agent 2 active/mysql.uptime)<10m'
name: 'MySQL: Service has been restarted'
event_name: 'MySQL: Service has been restarted (uptime < 10m)'
priority: INFO
description: 'MySQL uptime is less than 10 minutes.'
tags:
- tag: scope
value: notice
- uuid: 674df57b5295448c89a7265902cc94ec
name: Version
type: ZABBIX_ACTIVE
key: 'mysql.version["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
delay: 15m
value_type: CHAR
trends: '0'
description: 'MySQL server version.'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
tags:
- tag: component
value: application
triggers:
- uuid: 36ce1008736b4a109a060e1150fec15f
expression: 'last(/MySQL by Zabbix agent 2 active/mysql.version["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"],#1)<>last(/MySQL by Zabbix agent 2 active/mysql.version["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"],#2) and length(last(/MySQL by Zabbix agent 2 active/mysql.version["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]))>0'
name: 'MySQL: Version has changed'
event_name: 'MySQL: Version has changed (new version value received: {ITEM.VALUE})'
priority: INFO
description: 'The MySQL version has changed. Acknowledge to close the problem manually.'
manual_close: 'YES'
tags:
- tag: scope
value: notice
discovery_rules:
- uuid: 1d8d7069e0064521b52b388e0c6bc0a7
name: 'Database discovery'
type: ZABBIX_ACTIVE
key: 'mysql.db.discovery["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
delay: 1h
filter:
evaltype: AND
conditions:
- macro: '{#DATABASE}'
value: '{$MYSQL.DBNAME.MATCHES}'
formulaid: A
- macro: '{#DATABASE}'
value: '{$MYSQL.DBNAME.NOT_MATCHES}'
operator: NOT_MATCHES_REGEX
formulaid: B
description: 'Scanning databases in DBMS.'
item_prototypes:
- uuid: f69eb8da26de4abb92cec75161e703f3
name: 'Size of database {#DATABASE}'
type: ZABBIX_ACTIVE
key: 'mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#DATABASE}"]'
delay: 5m
units: B
description: 'Database size.'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: component
value: storage
- tag: database
value: '{#DATABASE}'
lld_macro_paths:
- lld_macro: '{#DATABASE}'
path: $.Database
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
- uuid: 66b3fda765c64b79b66a1ce97a7d19e8
name: 'MariaDB discovery'
type: DEPENDENT
key: mysql.extra_metric.discovery
delay: '0'
description: 'Used for additional metrics if MariaDB is used.'
item_prototypes:
- uuid: c0e3223f67014485ad5d56a174568f0b
name: 'Binlog commits'
type: DEPENDENT
key: 'mysql.binlog_commits[{#SINGLETON}]'
delay: '0'
value_type: FLOAT
description: 'Total number of transactions committed to the binary log.'
preprocessing:
- type: JSONPATH
parameters:
- $.Binlog_commits
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: transactions
- uuid: b530d1b7fd7c485ab412358d362aba41
name: 'Binlog group commits'
type: DEPENDENT
key: 'mysql.binlog_group_commits[{#SINGLETON}]'
delay: '0'
value_type: FLOAT
description: 'Total number of group commits done to the binary log.'
preprocessing:
- type: JSONPATH
parameters:
- $.Binlog_group_commits
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: transactions
- uuid: fd1d44c4dcf14ddda1da4687e2c3e2b6
name: 'Master GTID wait count'
type: DEPENDENT
key: 'mysql.master_gtid_wait_count[{#SINGLETON}]'
delay: '0'
value_type: FLOAT
description: 'The number of times `MASTER_GTID_WAIT` called.'
preprocessing:
- type: JSONPATH
parameters:
- $.Master_gtid_wait_count
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: transactions
- uuid: de68ab3003db47afa4714548d3dc0ff6
name: 'Master GTID wait timeouts'
type: DEPENDENT
key: 'mysql.master_gtid_wait_timeouts[{#SINGLETON}]'
delay: '0'
value_type: FLOAT
description: 'Number of timeouts occurring in `MASTER_GTID_WAIT`.'
preprocessing:
- type: JSONPATH
parameters:
- $.Master_gtid_wait_timeouts
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: transactions
- uuid: 1a2a6de9e9b3482780023b1375368b7d
name: 'Master GTID wait time'
type: DEPENDENT
key: 'mysql.master_gtid_wait_time[{#SINGLETON}]'
delay: '0'
value_type: FLOAT
description: 'Total number of time spent in `MASTER_GTID_WAIT`.'
preprocessing:
- type: JSONPATH
parameters:
- $.Master_gtid_wait_time
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.get_status_variables["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
tags:
- tag: component
value: transactions
master_item:
key: 'mysql.version["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
preprocessing:
- type: JAVASCRIPT
parameters:
- 'return JSON.stringify(value.search(''MariaDB'')>-1 ? [{''{#SINGLETON}'': ''''}] : []);'
- uuid: aaf6d2423fb34bef850be2d1be3fc36a
name: 'Replication discovery'
type: ZABBIX_ACTIVE
key: 'mysql.replication.discovery["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}"]'
delay: 1h
description: 'If "show slave status" returns Master_Host, "Replication: *" items are created.'
item_prototypes:
- uuid: 6284876731214fb8bf51f09dd40cf5fe
name: 'Replication Slave status {#MASTER_HOST}'
type: ZABBIX_ACTIVE
key: 'mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]'
history: '0'
value_type: TEXT
trends: '0'
description: 'The item gets status information on the essential parameters of the slave threads.'
tags:
- tag: component
value: raw
- uuid: f8d25b5c73474a048f7998ec75784b2a
name: 'Replication Seconds Behind Master {#MASTER_HOST}'
type: DEPENDENT
key: 'mysql.replication.seconds_behind_master["{#MASTER_HOST}"]'
delay: '0'
units: s
description: |
Number of seconds that the slave SQL thread is behind processing the master binary log.
A high number (or an increasing one) can indicate that the slave is unable to handle events
from the master in a timely fashion.
preprocessing:
- type: JSONPATH
parameters:
- $.Seconds_Behind_Master
- type: MATCHES_REGEX
parameters:
- \d+
error_handler: CUSTOM_ERROR
error_handler_params: 'Replication is not performed.'
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]'
tags:
- tag: component
value: replication
trigger_prototypes:
- uuid: a2d2da0c7df54bbfba3b1f50306c51d2
expression: 'min(/MySQL by Zabbix agent 2 active/mysql.replication.seconds_behind_master["{#MASTER_HOST}"],5m)>{$MYSQL.REPL_LAG.MAX.WARN}'
name: 'MySQL: Replication lag is too high'
event_name: 'MySQL: Replication lag is too high (over {$MYSQL.REPL_LAG.MAX.WARN} for 5m)'
priority: WARNING
description: 'Replication delay is too long.'
tags:
- tag: scope
value: notice
- uuid: 9e0917199e5c4552ab84df0b6f7f590c
name: 'Replication Slave IO Running {#MASTER_HOST}'
type: DEPENDENT
key: 'mysql.replication.slave_io_running["{#MASTER_HOST}"]'
delay: '0'
value_type: CHAR
trends: '0'
description: |
Whether the I/O thread for reading the master'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 SLAVE.
preprocessing:
- type: JSONPATH
parameters:
- $.Slave_IO_Running
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]'
tags:
- tag: component
value: replication
trigger_prototypes:
- uuid: 82ace91dce1c45b688ed62c438613510
expression: 'count(/MySQL by Zabbix agent 2 active/mysql.replication.slave_io_running["{#MASTER_HOST}"],#1,"ne","Yes")=1'
name: 'MySQL: The slave I/O thread is not connected to a replication master'
priority: WARNING
description: 'Whether the slave I/O thread is connected to the master.'
dependencies:
- name: 'MySQL: The slave I/O thread is not running'
expression: 'count(/MySQL by Zabbix agent 2 active/mysql.replication.slave_io_running["{#MASTER_HOST}"],#1,"eq","No")=1'
tags:
- tag: scope
value: availability
- uuid: 3eab03819bb84d48bba973c7060dcada
expression: 'count(/MySQL by Zabbix agent 2 active/mysql.replication.slave_io_running["{#MASTER_HOST}"],#1,"eq","No")=1'
name: 'MySQL: The slave I/O thread is not running'
priority: AVERAGE
description: 'Whether the I/O thread for reading the master''s binary log is running.'
tags:
- tag: scope
value: notice
- uuid: 438c4e34d77a43398503cf8ed5db034b
name: 'Replication Slave SQL Running {#MASTER_HOST}'
type: DEPENDENT
key: 'mysql.replication.slave_sql_running["{#MASTER_HOST}"]'
delay: '0'
value_type: CHAR
trends: '0'
description: |
Whether the SQL thread for executing events in the relay log is running.
As with the I/O thread, this should normally be Yes.
preprocessing:
- type: JSONPATH
parameters:
- $.Slave_SQL_Running
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
master_item:
key: 'mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]'
tags:
- tag: component
value: replication
trigger_prototypes:
- uuid: ee129bbeec9d42e1be803f58d0c6e1b9
expression: 'count(/MySQL by Zabbix agent 2 active/mysql.replication.slave_sql_running["{#MASTER_HOST}"],#1,"eq","No")=1'
name: 'MySQL: The SQL thread is not running'
priority: WARNING
description: 'Whether the SQL thread for executing events in the relay log is running.'
dependencies:
- name: 'MySQL: The slave I/O thread is not running'
expression: 'count(/MySQL by Zabbix agent 2 active/mysql.replication.slave_io_running["{#MASTER_HOST}"],#1,"eq","No")=1'
tags:
- tag: scope
value: notice
- uuid: 2db5da5c9069492c8a513bcd39e8d6d9
name: 'Replication Slave SQL Running State {#MASTER_HOST}'
type: DEPENDENT
key: 'mysql.replication.slave_sql_running_state["{#MASTER_HOST}"]'
delay: '0'
value_type: TEXT
trends: '0'
description: 'This shows the state of the SQL driver threads.'
preprocessing:
- type: JSONPATH
parameters:
- $.Slave_SQL_Running_State
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 6h
master_item:
key: 'mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]'
tags:
- tag: component
value: replication
lld_macro_paths:
- lld_macro: '{#MASTER_HOST}'
path: $.Master_Host
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
tags:
- tag: class
value: database
- tag: target
value: mysql
macros:
- macro: '{$MYSQL.ABORTED_CONN.MAX.WARN}'
value: '3'
description: 'Number of failed attempts to connect to the MySQL server for trigger expressions.'
- macro: '{$MYSQL.BUFF_UTIL.MIN.WARN}'
value: '50'
description: 'The minimum buffer pool utilization in percentage for trigger expressions.'
- macro: '{$MYSQL.CREATED_TMP_DISK_TABLES.MAX.WARN}'
value: '10'
description: 'The maximum number of temporary tables created on a disk per second for trigger expressions.'
- macro: '{$MYSQL.CREATED_TMP_FILES.MAX.WARN}'
value: '10'
description: 'The maximum number of temporary files created on a disk per second for trigger expressions.'
- macro: '{$MYSQL.CREATED_TMP_TABLES.MAX.WARN}'
value: '30'
description: 'The maximum number of temporary tables created in memory per second for trigger expressions.'
- macro: '{$MYSQL.DBNAME.MATCHES}'
value: .+
description: 'Filter of discoverable databases.'
- macro: '{$MYSQL.DBNAME.NOT_MATCHES}'
value: information_schema
description: 'Filter to exclude discovered databases.'
- macro: '{$MYSQL.DSN}'
value: '<Put your DSN>'
description: 'System data source name such as <tcp://host:port or unix:/path/to/socket)/>.'
- macro: '{$MYSQL.INNODB_LOG_FILES}'
value: '2'
description: 'Number of physical files in the InnoDB redo log for calculating `innodb_log_file_size`.'
- macro: '{$MYSQL.PASSWORD}'
description: 'MySQL user password.'
- macro: '{$MYSQL.REPL_LAG.MAX.WARN}'
value: 30m
description: 'Amount of time the slave is behind the master for trigger expressions.'
- macro: '{$MYSQL.SLOW_QUERIES.MAX.WARN}'
value: '3'
description: 'Number of slow queries for trigger expressions.'
- macro: '{$MYSQL.USER}'
description: 'MySQL user name.'
dashboards:
- uuid: 403df820c4d3431ba3d2879f6025389e
name: 'MySQL performance'
pages:
- widgets:
- type: graph
name: 'MySQL: Operations'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'MySQL by Zabbix agent 2 active'
name: 'MySQL: Operations'
- type: STRING
name: reference
value: AAAAA
- type: graph
name: 'MySQL: Connections'
'y': '5'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'MySQL by Zabbix agent 2 active'
name: 'MySQL: Connections'
- type: STRING
name: reference
value: AAAAC
- type: graph
name: 'MySQL: InnoDB buffer pool'
'y': '10'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'MySQL by Zabbix agent 2 active'
name: 'MySQL: InnoDB buffer pool'
- type: STRING
name: reference
value: AAAAE
- type: graph
name: 'MySQL: Queries'
x: '36'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'MySQL by Zabbix agent 2 active'
name: 'MySQL: Queries'
- type: STRING
name: reference
value: AAAAB
- type: graph
name: 'MySQL: Bandwidth'
x: '36'
'y': '5'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'MySQL by Zabbix agent 2 active'
name: 'MySQL: Bandwidth'
- type: STRING
name: reference
value: AAAAD
- type: graph
name: 'MySQL: Threads'
x: '36'
'y': '10'
width: '36'
height: '5'
fields:
- type: GRAPH
name: graphid.0
value:
host: 'MySQL by Zabbix agent 2 active'
name: 'MySQL: Threads'
- type: STRING
name: reference
value: AAAAF
valuemaps:
- uuid: 3592fb0098304d86ab35a6a86aa95ec5
name: 'Service state'
mappings:
- value: '0'
newvalue: Down
- value: '1'
newvalue: Up
graphs:
- uuid: 723784c0caba4856a7bb1e934c3ac54a
name: 'MySQL: Bandwidth'
graph_items:
- drawtype: GRADIENT_LINE
color: 199C0D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.bytes_received.rate
- sortorder: '1'
drawtype: GRADIENT_LINE
color: F63100
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.bytes_sent.rate
- uuid: 689482bd6602443f8b9dcdb16598a68e
name: 'MySQL: Connections'
graph_items:
- color: 199C0D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.aborted_clients.rate
- sortorder: '1'
color: F63100
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.aborted_connects.rate
- sortorder: '2'
color: 00611C
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.connections.rate
- sortorder: '3'
color: F7941D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.max_used_connections
- uuid: cdfec90ec0894187a52050f3fc738be7
name: 'MySQL: InnoDB buffer pool'
graph_items:
- color: 199C0D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.innodb_buffer_pool_pages_free
- sortorder: '1'
color: F63100
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.innodb_buffer_pool_pages_total
- sortorder: '2'
color: 00611C
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.innodb_buffer_pool_read_requests.rate
- sortorder: '3'
color: F7941D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.innodb_buffer_pool_reads.rate
- uuid: 494552acd11044ef8fbea28d81c02e7d
name: 'MySQL: Operations'
graph_items:
- color: 199C0D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.com_delete.rate
- sortorder: '1'
color: F63100
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.com_insert.rate
- sortorder: '2'
color: 00611C
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.com_select.rate
- sortorder: '3'
color: F7941D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.com_update.rate
- uuid: ec0107cf2ef4499ca6522a66bc915dbd
name: 'MySQL: Queries'
graph_items:
- color: 199C0D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.queries.rate
- sortorder: '1'
color: F63100
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.questions.rate
- sortorder: '2'
color: 00611C
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.slow_queries.rate
- uuid: 3e3616b5661546c98d20e9b1ef32c214
name: 'MySQL: Threads'
graph_items:
- color: 199C0D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.threads_cached
- sortorder: '1'
color: F63100
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.threads_connected
- sortorder: '2'
color: 00611C
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.threads_created.rate
- sortorder: '3'
color: F7941D
item:
host: 'MySQL by Zabbix agent 2 active'
key: mysql.threads_running