{"id":20162888,"url":"https://github.com/actiontech/actiontech_zabbix_mysql_monitor","last_synced_at":"2025-04-10T00:36:28.291Z","repository":{"id":57597828,"uuid":"44721828","full_name":"actiontech/actiontech_zabbix_mysql_monitor","owner":"actiontech","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-24T08:05:22.000Z","size":18125,"stargazers_count":57,"open_issues_count":4,"forks_count":35,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T02:22:10.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/actiontech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-22T04:19:36.000Z","updated_at":"2023-06-09T08:41:57.000Z","dependencies_parsed_at":"2022-08-28T09:11:34.901Z","dependency_job_id":null,"html_url":"https://github.com/actiontech/actiontech_zabbix_mysql_monitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actiontech%2Factiontech_zabbix_mysql_monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actiontech%2Factiontech_zabbix_mysql_monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actiontech%2Factiontech_zabbix_mysql_monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actiontech%2Factiontech_zabbix_mysql_monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actiontech","download_url":"https://codeload.github.com/actiontech/actiontech_zabbix_mysql_monitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137996,"owners_count":21053773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:27:16.907Z","updated_at":"2025-04-10T00:36:28.271Z","avatar_url":"https://github.com/actiontech.png","language":"Go","readme":"# actiontech zabbix mysql monitor\r\n\r\npercona monitoring plugins zabbix的go语言版本\r\n\r\n## 0. 版本下载使用1.0分支  \r\n\r\n## 1. item取值与percona版本差异\r\n使用mysqld端口自动发现相关item（zabbix Low level discovery）  \r\n - innodb_transactions  \r\n取值方法：`SHOW /\\*!50000 ENGINE*/ INNODB STATUS`,可得行Trx id counter 861144，取值861144  \r\npercona将861144作为十六进制字符解析，actiontech版本将861144作为十进制字符解析\r\n - unpurged_txns：  \r\n取值方法：`SHOW /\\*!50000 ENGINE*/ INNODB STATUS`,可得行`Purge done for trx's n:o \u003c 861135 undo n:o \u003c 0`，取值861135  \r\npercona将861135作为十六进制字符解析，actiontech版本将861135作为十进制字符解析 \r\n - running_slave，slave_lag:  \r\n取值方法：如果`SHOW SLAVE STATUS`为空，认为该mysql为master，设置running_slave=1，slave_lag=0；如果`SHOW SLAVE STATUS`不为空，与percona处理相同，依据slave_io_running及slave_sql_running等具体参数值设置\r\n - 增加mysqld_port_listen  \r\n取值方法：`netstat -ntlp |awk -F '[ ]+|/' '$4~/:port$/{print $8}'`其中port为参数传入值   \r\n若上述命令结果等于`mysqld`，则值为1，反之为0  \r\n - 增加query_rt100s、query_rt10s、query_rt1s、query_rt100ms、query_rt10ms、query_rt1ms(默认关闭，设置get_qrt_mysql参数可开启)  \r\n取值方法`SELECT 'query_rt100s' as rt, ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT \u003e= 100000000000000 UNION\r\nSELECT 'query_rt10s', ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT BETWEEN 10000000000000 AND 10000000000000 UNION \r\nSELECT 'query_rt1s', ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT BETWEEN 1000000000000 AND 10000000000000 UNION \r\nSELECT 'query_rt100ms', ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT BETWEEN 100000000000 AND 1000000000000 UNION \r\nSELECT 'query_rt10ms', ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT BETWEEN 10000000000 AND 100000000000 UNION \r\nSELECT 'query_rt1ms', ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT BETWEEN 1000000000 AND 10000000000 UNION \r\nSELECT 'query_rt100us', ifnull(sum(COUNT_STAR),0) as cnt FROM performance_schema.events_statements_summary_by_digest WHERE AVG_TIMER_WAIT \u003c= 1000000000`  \r\n - 增加query_avgrt(默认关闭，设置get_qrt_mysql参数可开启)     \r\n取值方法:`select round(avg(AVG_TIMER_WAIT)/1000/1000/1000,2) as avgrt from performance_schema.events_statements_summary_by_digest`  \r\n - 去除`SHOW /\\*!50000 ENGINE*/ INNODB STATUS`输出中`INDIVIDUAL BUFFER POOL INFO`段落的信息，避免重复计算   \r\n - spin_rounds  \r\n 取值方法：`SHOW /\\*!50000 ENGINE*/ INNODB STATUS`,可得行\r\n`Mutex spin waits 2537, rounds 28527, OS waits 789\r\nRW-shared spins 535, rounds 7850, OS waits 251\r\nRW-excl spins 172, rounds 2334, OS waits 62`取值`spin_rounds = 28527 + 7850 + 2334`  \r\npercona取值spin_rounds = 28527，actiontech版本增加RW-shared spins rounds以及RW-excl spin rounds  \r\n\r\n## 2. trigger与percona版本差异\r\n- 增加MySQL {#MYSQLPORT} max_connections less than 4999 on {HOST.NAME}  \r\n- 增加MySQL {#MYSQLPORT} Open_files_limit less than 65534 on {HOST.NAME}  \r\n- 增加MySQL {#MYSQLPORT} port is not in listen state on {HOST.NAME}  \r\n- 增加{#MYSQLPORT} port mysql is down on {HOST.NAME}  \r\n- 删除原有的使用proc num监控的MySQL is down trigger(多实例下结果不正确)  \r\n- 删除原有的mysql active threads more than 40, mysql connections utilization more than 80%, mysql slave lag more than 300的trigger(zabbix 2.4 LLD下的trigger没有depend功能, 删除这些原本依赖depend的trigger以避免错误)  \r\n\r\n## 3. 限制\r\n- 暂不支持mysql ssl连接方式\r\n- 不完全支持Percona Server or MariaDB\r\n- 仅支持zabbix2.4.0及以上版本  \r\n\r\n## 4. 增加对mysql 5.7支持  \r\n### 针对`SHOW /*!50000 ENGINE*/ INNODB STATUS`输出  \r\n5.6与5.7的几句差异  \r\nmysql 5.6   \r\n- SEMAPHORES输出    \r\nMutex spin waits 2537, rounds 28527, OS waits 789  \r\nRW-shared spins 535, rounds 7850, OS waits 251  \r\nRW-excl spins 172, rounds 2334, OS waits 62  \r\n计算：  \r\nspin_waits = 2537 + 535 + 172    \r\nspin_rounds = 28527 + 7850 + 2334  \r\nos_waits = 789 + 251 + 62  \r\n  \r\n  \r\n- FILE I/O输出  \r\nPending normal aio reads: 0, aio writes: 0,  \r\nibuf aio reads: 0, log i/o's: 0, sync i/o's: 0  \r\n计算：  \r\npending_normal_aio_reads = 0  \r\npending_normal_aio_writes = 0  \r\npending_ibuf_aio_reads = 0  \r\npending_aio_log_ios = 0   \r\npending_aio_sync_ios = 0   \r\n  \r\n- LOG输出  \r\n0 pending log writes, 0 pending chkp writes  \r\n计算：  \r\npending_log_writes = 0   \r\npending_chkp_writes = 0  \r\n\r\n- BUFFER POOL AND MEMORY输出  \r\nTotal memory allocated 137363456; in additional pool allocated 0  \r\n计算：  \r\ntotal_mem_alloc = 137363456  \r\nadditional_pool_alloc = 0  \r\n\r\n\r\n\r\nmysql 5.7\r\n- SEMAPHORES输出（移除Mutex spin，新增RW-sx spins）  \r\nRW-shared spins 500, rounds 132474, OS waits 100787  \r\nRW-excl spins 0, rounds 200953, OS waits 6214   \r\nRW-sx spins 28837, rounds 826250, OS waits 26397  \r\n计算：  \r\nspin_waits = 500 + 0 + 28837  \r\nspin_rounds = 132474 + 200953 + 826250  \r\nos_waits = 100787 + 6214 + 26397  \r\n  \r\n- FILE I/O输出（拆分为每个io thread的值）  \r\nPending normal aio reads: [1, 2, 3, 4] , aio writes: [5, 6, 7, 8] ,  \r\nibuf aio reads:, log i/o's:, sync i/o's:  \r\n计算：  \r\n数组全部元素相加， 空值为0  \r\npending_normal_aio_reads = 1 + 2 + 3 + 4  \r\npending_normal_aio_writes = 5 + 6 + 7 + 8  \r\npending_ibuf_aio_reads = 0  \r\npending_aio_log_ios = 0  \r\npending_aio_sync_ios = 0   \r\n  \r\n- LOG输出  \r\n1 pending log flushes, 0 pending chkp writes  \r\nlog flushes 与 log writes意义相同，计算方式不变  \r\n计算：   \r\npending_log_writes = 1   \r\npending_chkp_writes = 0  \r\n  \r\n- BUFFER POOL AND MEMORY输出（移除in additional pool allocated）  \r\nTotal large memory allocated 137428992  \r\n计算：  \r\ntotal_mem_alloc = 137428992  \r\nadditional_pool_alloc = 0  \r\n\r\n### 针对`SHOW SLAVE STATUS`输出，支持多源复制   \r\nslave_lag: 取多通道中seconds_behind_master的最大值  \r\nrunning_slave: 当所有通道的slave_io_running和slave_sql_running状态为Yes时, runing_slave值为1  \r\nrelay_log_space: 取所有通道的relay_log_space的和  \r\n\r\n\r\n## 5. 安装\r\n1. 安装zabbix-agent  \r\n2. 执行install.sh  \r\n//请检查确保/etc/sudoers中包含#includedir /etc/sudoers.d\r\n//install.sh作用仅为拷贝文件至默认路径，可自行调整  \r\n3. 创建采集mysql状态信息的用户  \r\n`mysql\u003e grant process,select,replication client on *.* to zbx@’127.0.0.1’ identified by 'zabbix';`   \r\n4. 拷贝  \r\n`cp /var/lib/zabbix/actiontech/templates/userparameter_actiontech_mysql.conf /etc/zabbix/zabbix_agentd.d/`  \r\n//若改变登陆密码或默认路径，请相应调整userparameter_actiontech_mysql.conf  \r\n重启agent  \r\n`service zabbix-agent restart`  \r\n5. 测试数据采集  \r\n`sudo -u zabbix -H /var/lib/zabbix/actiontech/scripts/actiontech_mysql_monitor --host 127.0.0.1 --user zbx --pass zabbix --items max_connections`   \r\n//被监控mysql最大连接数  \r\n`sudo -u zabbix -H /var/lib/zabbix/actiontech/scripts/actiontech_mysql_monitor --host 127.0.0.1 --user zbx --pass zabbix --items running_slave`  \r\n//主从复制状态  \r\n`sudo -u zabbix -H /var/lib/zabbix/actiontech/scripts/actiontech_mysql_monitor --discovery_port true`   \r\n//json格式的mysqld端口占用   \r\n`sudo -u zabbix -H /var/lib/zabbix/actiontech/scripts/actiontech_mysql_monitor --port 3306 --items mysqld_port_listen`  \r\n//3306端口是否被mysqld占用  \r\n6. zabbix server导入配置模板actiontech_zbx_3.x_template_mysql_server.xml， 添加主机、模板，开始监控  \r\n\r\n\r\n## 6. 文件列表\r\n\r\n|文件名|对应percona版本文件名|\r\n|------|------|\r\n|无|get_mysql_stats_wrapper.sh|\r\n|actiontech_mysql_monitor|ss_get_mysql_stats.php|\r\n|userparameter_actiontech_mysql.conf|userparameter_percona_mysql.conf|\r\n|zabbix版本\u003c=3.0使用actiontech_zbx_3.0_template_mysql_server.xml； zabbix版本==3.4使用actiontech_zbx_3.4_template_mysql_server.xml|zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.5.xml|\r\n|install.sh|无|\r\n\r\n\r\n- actiontech_mysql_monitor  \r\n默认路径：`/var/lib/zabbix/actiontech/scripts/actiontech_mysql_monitor`  \r\n备注：二进制可执行文件，可单独使用（actiontech_mysql_monitor --help查看帮助actiontech_mysql_monitor --version查询版本） \r\n- userparameter_actiontech_mysql.conf  \r\n默认路径：`/var/lib/zabbix/actiontech/templates/userparameter_actiontech_mysql.conf`  \r\n备注：zabbix-agent的key配置文件  \r\n- actiontech_zbx_3.x_template_mysql_server.xml.xml  \r\n默认路径：`/var/lib/zabbix/actiontech/templates/actiontech_zbx_3.x_template_mysql_server.xml.xml`  \r\n备注：模板文件，可导入zabbix  \r\n\r\n\r\n\r\n\r\n## 7. 所有item及其出处列表\r\n\r\n| item名         | 相关出处 | 引入版本(默认1.0) |\r\n| ------------- | -----|  -----| \r\n|\t\tKey_read_requests|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tKey_reads|                  SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tKey_write_requests|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tKey_writes|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\thistory_list|               SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tinnodb_transactions|        SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tread_views|                 SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tcurrent_transactions|       SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tlocked_transactions|        SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tactive_transactions|        SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpool_size|                  Innodb_buffer_pool_pages_total or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tfree_pages|                 Innodb_buffer_pool_pages_free or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tdatabase_pages|            Innodb_buffer_pool_pages_data or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tmodified_pages|             Innodb_buffer_pool_pages_dirty or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpages_read|                 pages_read or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpages_created|              Innodb_pages_created or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpages_written|              pages_written or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tfile_fsyncs|                Innodb_data_fsyncs or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tfile_reads|                 SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tfile_writes|                SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tlog_writes|                 SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_aio_log_ios|        SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_aio_sync_ios|       SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_buf_pool_flushes|   SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_chkp_writes|        SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_ibuf_aio_reads|     SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_log_flushes|        Innodb_os_log_pending_fsyncs or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_log_writes|         SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_normal_aio_reads|   Innodb_data_pending_reads or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpending_normal_aio_writes|  Innodb_data_pending_writes or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tibuf_inserts|               SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tibuf_merged|                SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tibuf_merges|                SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tspin_waits|                 SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tspin_rounds|                SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tos_waits|                   SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\trows_inserted|              Innodb_rows_inserted or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\trows_updated|               Innodb_rows_updated or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\trows_deleted|               Innodb_rows_deleted or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\trows_read|                  Innodb_rows_read or SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tTable_locks_waited|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tTable_locks_immediate|      SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSlow_queries|               SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tOpen_files|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tOpen_tables|                SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tOpened_tables|              SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tinnodb_open_files|          SHOW VARIABLES|\r\n|\t\topen_files_limit|           SHOW VARIABLES|\r\n|\t\ttable_cache|                SHOW VARIABLES|\r\n|\t\tAborted_clients|            SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tAborted_connects|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tMax_used_connections|       SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSlow_launch_threads|        SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tThreads_cached|             SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tThreads_connected|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tThreads_created|            SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tThreads_running|            SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tmax_connections|            SHOW VARIABLES|\r\n|\t\tthread_cache_size|          SHOW VARIABLES|\r\n|\t\tConnections|                SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tslave_running|              slave_lag or 0 |\r\n|\t\tslave_stopped|              slave_lag or 0|\r\n|\t\tSlave_retried_transactions| SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tslave_lag|                  SHOW SLAVE STATUS or percona.heartbeat|\r\n|\t\tSlave_open_temp_tables|     SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_free_blocks|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_free_memory|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_hits|                SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_inserts|             SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_lowmem_prunes|       SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_not_cached|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_queries_in_cache|    SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQcache_total_blocks|        SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tquery_cache_size|           SHOW VARIABLES|\r\n|\t\tQuestions|                  SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_update|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_insert|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_select|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_delete|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_replace|                SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_load|                   SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_update_multi|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_insert_select|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_delete_multi|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCom_replace_select|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSelect_full_join|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSelect_full_range_join|     SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSelect_range|               SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSelect_range_check|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSelect_scan|                SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSort_merge_passes|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSort_range|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSort_rows|                  SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tSort_scan|                  SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCreated_tmp_tables|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCreated_tmp_disk_tables|    SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tCreated_tmp_files|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tBytes_sent|                 SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tBytes_received|             SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tinnodb_log_buffer_size|     SHOW VARIABLES|\r\n|\t\tunflushed_log|              log_bytes_written-log_bytes_flushed or innodb_log_buffer_size|\r\n|\t\tlog_bytes_flushed|          SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tlog_bytes_written|          SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\trelay_log_space|            SHOW SLAVE STATUS|\r\n|\t\tbinlog_cache_size|          SHOW VARIABLES|\r\n|\t\tBinlog_cache_disk_use|      SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tBinlog_cache_use|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tbinary_log_space|           SHOW MASTER LOGS|\r\n|\t\tinnodb_locked_tables|       SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tinnodb_lock_structs|        SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tState_closing_tables|       SHOW PROCESSLIST|\r\n|\t\tState_copying_to_tmp_table| SHOW PROCESSLIST|\r\n|\t\tState_end|                  SHOW PROCESSLIST|\r\n|\t\tState_freeing_items|        SHOW PROCESSLIST|\r\n|\t\tState_init|                 SHOW PROCESSLIST|\r\n|\t\tState_locked|               SHOW PROCESSLIST|\r\n|\t\tState_login|                SHOW PROCESSLIST|\r\n|\t\tState_preparing|            SHOW PROCESSLIST|\r\n|\t\tState_reading_from_net|     SHOW PROCESSLIST|\r\n|\t\tState_sending_data|         SHOW PROCESSLIST|\r\n|\t\tState_sorting_result|       SHOW PROCESSLIST|\r\n|\t\tState_statistics|           SHOW PROCESSLIST|\r\n|\t\tState_updating|             SHOW PROCESSLIST|\r\n|\t\tState_writing_to_net|       SHOW PROCESSLIST|\r\n|\t\tState_none|                 SHOW PROCESSLIST|\r\n|\t\tState_other|                SHOW PROCESSLIST|\r\n|\t\tTime_top_1|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_2|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_3|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_4|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_5|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_6|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_7|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_8|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_9|                 SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tTime_top_10|                SHOW PROCESSLIST|1.1版本引入|\r\n|\t\tHandler_commit|             SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_delete|             SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_discover|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_prepare|            SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_read_first|         SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_read_key|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_read_next|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_read_prev|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_read_rnd|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_read_rnd_next|      SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_rollback|           SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_savepoint|          SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_savepoint_rollback| SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_update|             SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tHandler_write|              SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tinnodb_tables_in_use|       SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tinnodb_lock_wait_secs|      SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\thash_index_cells_total|     SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\thash_index_cells_used|      SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\ttotal_mem_alloc|            SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tadditional_pool_alloc|      SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tuncheckpointed_bytes|       log_bytes_written-last_checkpoint|\r\n|\t\tibuf_used_cells|            SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tibuf_free_cells|            SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tibuf_cell_count|            SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tadaptive_hash_memory|       SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tpage_hash_memory|           SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tdictionary_cache_memory|    SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tfile_system_memory|         SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tlock_system_memory|         SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\trecovery_system_memory|     SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tthread_hash_memory|         SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tinnodb_sem_waits|           SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tinnodb_sem_wait_time_ms|    SHOW /\\*!50000 ENGINE*/ INNODB STATUS|\r\n|\t\tKey_buf_bytes_unflushed|    key_cache_block_size*Key_blocks_not_flushed|\r\n|\t\tKey_buf_bytes_used|         key_buffer_size-(Key_blocks_unused*key_cache_block_size)|\r\n|\t\tkey_buffer_size|            SHOW VARIABLES|\r\n|\t\tInnodb_row_lock_time|       SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tInnodb_row_lock_waits|      SHOW /*!50002 GLOBAL */ STATUS|\r\n|\t\tQuery_time_count_00|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_01|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_02|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_03|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_04|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_05|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_06|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_07|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_08|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_09|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_10|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_11|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_12|        Percona Server or MariaDB|\r\n|\t\tQuery_time_count_13|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_00|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_01|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_02|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_03|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_04|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_05|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_06|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_07|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_08|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_09|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_10|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_11|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_12|        Percona Server or MariaDB|\r\n|\t\tQuery_time_total_13|        Percona Server or MariaDB|\r\n|\t\twsrep_replicated_bytes|     Percona Server or MariaDB|\r\n|\t\twsrep_received_bytes|       Percona Server or MariaDB|\r\n|\t\twsrep_replicated|           Percona Server or MariaDB|\r\n|\t\twsrep_received|             Percona Server or MariaDB|\r\n|\t\twsrep_local_cert_failures|  Percona Server or MariaDB|\r\n|\t\twsrep_local_bf_aborts|      Percona Server or MariaDB|\r\n|\t\twsrep_local_send_queue|     Percona Server or MariaDB|\r\n|\t\twsrep_local_recv_queue|     Percona Server or MariaDB|\r\n|\t\twsrep_cluster_size|         Percona Server or MariaDB|\r\n|\t\twsrep_cert_deps_distance|   Percona Server or MariaDB|\r\n|\t\twsrep_apply_window|         Percona Server or MariaDB|\r\n|\t\twsrep_commit_window|        Percona Server or MariaDB|\r\n|\t\twsrep_flow_control_paused|  Percona Server or MariaDB|\r\n|\t\twsrep_flow_control_sent|    Percona Server or MariaDB|\r\n|\t\twsrep_flow_control_recv|    Percona Server or MariaDB|\r\n|\t\tpool_reads|                 Innodb_buffer_pool_reads|\r\n|\t\tpool_read_requests|         Innodb_buffer_pool_read_requests|\r\n|\t\trunning_slave|              SHOW SLAVE STATUS|\r\n|       mysqld_port_listen|         netstat -ntlp    |\r\n|       query_rt100s|performance_schema.events_statements_summary_by_digest|\r\n|       query_rt10s|performance_schema.events_statements_summary_by_digest|\r\n|       query_rt1s| performance_schema.events_statements_summary_by_digest|\r\n|       query_rt100ms| performance_schema.events_statements_summary_by_digest|\r\n|       query_rt10ms| performance_schema.events_statements_summary_by_digest|\r\n|       query_rt1ms|performance_schema.events_statements_summary_by_digest|\r\n|       query_avgrt |performance_schema.events_statements_summary_by_digest|\r\n|       read_only |                 SHOW VARIABLES|\r\n|\t\tserver_id |                 SHOW VARIABLES|\r\n|       uncommitted_trx_duration_top_1 |information_schema.processlist and information_schema.innodb_trx|\r\n|       uncommitted_trx_duration_top_2 |information_schema.processlist and information_schema.innodb_trx|\r\n|       uncommitted_trx_duration_top_3 |information_schema.processlist and information_schema.innodb_trx|\r\n\r\n\r\n\r\n\r\n## 8. trigger列表\r\n注：以下列表未列出trigger依赖，详情可见actiontech_zbx_3.x_template_mysql_server.xml.xml  \r\n\r\n| trigger名        |触发器表达式   |\r\n| ------------- | -----| \r\n|MySQL is down on {HOST.NAME}|{proc.num[mysqld].last(0)}=0|\r\n|MySQL {#MYSQLPORT} connections utilization more than 95% on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},Threads_connected].last(0)}/{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},max_connections].last(0)}\u003e0.95|\r\n|MySQL {#MYSQLPORT} active threads more than 100 on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},Threads_running].last(0)}\u003e100|\r\n|MySQL {#MYSQLPORT} slave lag more than 600 on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},slave_lag].last(0)}\u003e600|\r\n|Slave {#MYSQLPORT} is stopped on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},running_slave].last(0)}=0|\r\n|MySQL {#MYSQLPORT} max_connections less than 4999 on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},max_connections].last(0)}\u003c4999|\r\n|MySQL {#MYSQLPORT} Open_files_limit less than 65534 on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},open_files_limit].last(0)}\u003c65534|\r\n|MySQL {#MYSQLPORT} port is not in listen state on {HOST.NAME}|{Actiontech MySQL Server Template:net.tcp.listen[{#MYSQLPORT}].last(0)}=0|\r\n|{#MYSQLPORT} port is not mysqld on {HOST.NAME}|{Actiontech MySQL Server Template:MySQL.[{#MYSQLPORT},mysqld_port_listen].last(0)}=0|\r\n\r\n## 9. issues\r\n- 欢迎在issues中提出任何使用问题\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiontech%2Factiontech_zabbix_mysql_monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factiontech%2Factiontech_zabbix_mysql_monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiontech%2Factiontech_zabbix_mysql_monitor/lists"}