发布网友 发布时间:2022-04-23 00:58
共4个回答
懂视网 时间:2022-04-30 08:31
在zabbix的agent端添加配置文件
# vim /etc/zabbix/mysql/.my.cnf 用于连接MySQL的配置文件,无需显示输入用户和密码
[client]
host = localhost
user = root
password = 123456
socket = /usr/local/mysql/mysql.sock
[mysql]
host = localhost
user = root
password =123456
socket = /usr/local/mysql/mysql.sock
[mysqladmin]
host = localhost
user = root
password = 123456
socket = /usr/local/mysql/mysql.sock
# vim /usr/local/zabbix/etc/zabbix_agentd.conf.d/userparameter_mysql.conf 提供监控MySQL的用户自定义参数
UserParameter=mysql.version,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -V
UserParameter=mysql.ping,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot ping | grep -c alive
UserParameter=mysql.status[*],HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
UserParameter=mysql.Ping,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot ping|grep alive|wc -l
UserParameter=mysql.Threads,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
UserParameter=mysql.Questions,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
UserParameter=mysql.Slowqueries,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
UserParameter=mysql.Qps,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysqladmin -uroot status|cut -f9 -d":"
UserParameter=mysql.Slave_IO_State,if [ "$(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show slave statusG"| grep Slave_IO_Running|awk ‘{print $2}‘)" == "Y
es" ];then echo 1; else echo 0;fi
UserParameter=mysql.Slave_SQL_State,if [ "$(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show slave statusG"| grep Slave_SQL_Running|sed -n ‘1p‘|awk ‘{prin
t $2}‘)" == "Yes" ];then echo 1; else echo 0;fi
UserParameter=mysql.Slave_Delay,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show slave statusG"| grep Seconds_Behind_Master|sed -n ‘1p‘|awk ‘{print $2}‘
UserParameter=mysql.Key_buffer_size,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘key_buffer_size‘;"| grep -v Value |awk ‘{print $2/1024
^2}‘
UserParameter=mysql.Key_reads,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_reads‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Key_read_requests,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_read_requests‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Key_cache_miss_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_reads‘;"| grep -v Value |awk ‘{print $2}‘)
$(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_read_requests‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",$1/$2*100)}
‘
UserParameter=mysql.Key_blocks_used,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_blocks_used‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Key_blocks_unused,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_blocks_unused‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Key_blocks_used_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_blocks_used‘;"| grep -v Value |awk ‘{prin
t $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘key_blocks_unused‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",$1/(
$1+$2)*100)}‘
UserParameter=mysql.Innodb_buffer_pool_size,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘innodb_buffer_pool_size‘;"| grep -v Value |awk
‘{print $2/1024^2}‘
UserParameter=mysql.Innodb_log_file_size,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘innodb_log_file_size‘;"| grep -v Value |awk ‘{pri
nt $2/1024^2}‘
UserParameter=mysql.Innodb_log_buffer_size,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘innodb_log_buffer_size‘;"| grep -v Value |awk ‘
{print $2/1024^2}‘
UserParameter=mysql.Table_open_cache,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘table_open_cache‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Open_tables,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘open_tables‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Opened_tables,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘opened_tables‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Open_tables_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘open_tables‘;"| grep -v Value |awk ‘{print $2}‘)
$(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘opened_tables‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",$1/($1+$2)*100)}
‘
UserParameter=mysql.Table_open_cache_used_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘open_tables‘;"| grep -v Value |awk ‘{pr
int $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘table_open_cache‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",
$1/($1+$2)*100)}‘
UserParameter=mysql.Thread_cache_size,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘thread_cache_size‘;"| grep -v Value |awk ‘{print $2}
‘
UserParameter=mysql.Threads_cached,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Threads_cached‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Threads_connected,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Threads_connected‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Threads_created,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Threads_created‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Threads_running,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Threads_running‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Qcache_free_blocks,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_free_blocks‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Qcache_free_memory,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_free_memory‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Qcache_hits,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_hits‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Qcache_inserts,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_inserts‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Qcache_lowmem_prunes,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_lowmem_prunes‘;"| grep -v Value |awk ‘{print
$2}‘
UserParameter=mysql.Qcache_not_cached,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_not_cached‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Qcache_queries_in_cache,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_queries_in_cache‘;"| grep -v Value |awk ‘{
print $2}‘
UserParameter=mysql.Qcache_total_blocks,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_total_blocks‘;"| grep -v Value |awk ‘{print $2
}‘
UserParameter=mysql.Qcache_fragment_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_free_blocks‘;"| grep -v Value |awk ‘{p
rint $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_total_blocks‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f "
,$1/$2*100)}‘
UserParameter=mysql.Qcache_used_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘query_cache_size‘;"| grep -v Value |awk ‘{prin
t $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_free_memory‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",($1
-$2)/$1*100)}‘
UserParameter=mysql.Qcache_hits_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_hits‘;"| grep -v Value |awk ‘{print $2}‘)
$(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Qcache_inserts‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{if($1 == 0){print 0;}else {print
f("%1.4f ",($1-$2)/$1*100);}}‘
UserParameter=mysql.Query_cache_limit,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘query_cache_limit‘;"| grep -v Value |awk ‘{print $2}
‘
UserParameter=mysql.Query_cache_min_res_unit,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘query_cache_min_res_unit‘;"| grep -v Value |a
wk ‘{print $2}‘
UserParameter=mysql.Query_cache_size,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘query_cache_size‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Sort_merge_passes,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Sort_merge_passes‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Sort_range,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Sort_range‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Sort_rows,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Sort_rows‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Sort_scan,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Sort_scan‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Handler_read_first,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_first‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Handler_read_key,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_key‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Handler_read_next,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_next‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Handler_read_prev,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_prev‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Handler_read_rnd,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_rnd‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Handler_read_rnd_next,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_rnd_next‘;"| grep -v Value |awk ‘{prin
t $2}‘
UserParameter=mysql.Com_select,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_select‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Com_insert,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_insert‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Com_insert_select,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_insert_select‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Com_update,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_update‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Com_replace,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_replace‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Com_replace_select,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_replace_select‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Table_scan_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Handler_read_rnd_next‘;"| grep -v Value |awk ‘{pri
nt $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘com_select‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",$1/$2*100)
}‘
UserParameter=mysql.Open_files,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘open_files‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Open_files_limit,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘open_files_limit‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Open_files_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘open_files‘;"| grep -v Value |awk ‘{print $2}‘) $(
HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘open_files_limit‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{printf("%1.4f ",$1/$2*100)}‘
UserParameter=mysql.Created_tmp_disk_tables,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘created_tmp_disk_tables‘;"| grep -v Value |awk ‘{
print $2}‘
UserParameter=mysql.Created_tmp_tables,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘created_tmp_tables‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Created_tmp_disk_tables_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘created_tmp_disk_tables‘;"| grep -v V
alue |awk ‘{print $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘created_tmp_tables‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{if($
2 == 0){print 0;}else {printf("%1.4f ",$1/$2*100);}}‘
UserParameter=mysql.Max_connections,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘max_connections‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Max_used_connections,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Max_used_connections‘;"| grep -v Value |awk ‘{print
$2}‘
UserParameter=mysql.Max_connections_used_rate,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Max_used_connections‘;"| grep -v Value |
awk ‘{print $2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show variables like ‘max_connections‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{if($2 == 0
){print 0;}else {printf("%1.4f ",$1/$2*100);}}‘
UserParameter=mysql.Table_locks_immediate,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Table_locks_immediate‘;"| grep -v Value |awk ‘{prin
t $2}‘
UserParameter=mysql.Table_locks_waited,HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘table_locks_waited‘;"| grep -v Value |awk ‘{print $2}‘
UserParameter=mysql.Engine_select,echo $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘Table_locks_immediate‘;"| grep -v Value |awk ‘{print
$2}‘) $(HOME=/etc/zabbix/mysql /usr/local/mysql/bin/mysql -uroot -e "show status like ‘table_locks_waited‘;"| grep -v Value |awk ‘{print $2}‘)| awk ‘{if($2 == 0){print 0;}
else {printf("%1.4f ",$1/$2);}}‘
在 /usr/local/zabbix/etc/zabbix_agentd.conf 添加如下一行
Include=usr/local/zabbix/etc/zabbix_agentd.conf.d/userparameter_mysql.conf
重启zabb_agentd
# /etc/init.d/zabbix_agentd restart
导入MySQL的模版
1)选择“组态”-->"模版" 点击“汇入”
2)然后选择要导入的模版,并点击导入即可
按照上边步骤导入MySQL Slave的监控模版即可
链接导入的模版即可
通过最新数据可以查看MySQL的状态,以及主从复制的状态和延迟
zabbix监控MySQL服务器的模版(具体模版在附件中)
监控MySQL的通用模版:Template_MySQL.xm
MySQL的Slave模版:Template_MySQL_Slave.xml
本文出自 “Linux之旅” 博客,请务必保留此出处http://openlinuxfly.blog.51cto.com/7120723/1675367
zabbix之监控MySQL服务器(可用于主从架构)
标签:zabbix模版 监控主从复制(master-slave) 监控mysql服务器监控
热心网友 时间:2022-04-30 05:39
使用 bcc 工具观测 MySQL:1)dbstat功能:将 MySQL/PostgreSQL 的查询延迟汇总为直方图
语法:
dbstat [-h] [-v] [-p [PID [PID ...]]] [-m THRESHOLD] [-u] [-i INTERVAL] {mysql,postgres}
选项:
{mysql,postgres} # 观测哪种数据库-h, --help # 显示帮助然后退出-v, --verbose # 显示BPF程序-p [PID [PID ...]], --pid [PID [PID ...]] # 要观测的进程号,空格分隔-m THRESHOLD, --threshold THRESHOLD # 只统计查询延迟比此阈值高的-u, --microseconds # 以微秒为时间单位来显示延迟(默认单位:毫秒)-i INTERVAL, --interval INTERVAL # 打印摘要的时间间隔(单位:秒)
示例:
# 使用 sysbench 在被观测数据库上执行 select[root@liuan tools]# dbstat mysql -p `pidof mysqld` -uTracing database queries for pids 3350 slower than 0 ms...^C[14:42:26] query latency (us)
2)dbslower
功能:跟踪 MySQL/PostgreSQL 的查询时间高于阈值
语法:
dbslower [-h] [-v] [-p [PID [PID ...]]] [-x PATH] [-m THRESHOLD] {mysql,postgres}
参数:
{mysql,postgres} # 观测哪种数据库 -h, --help # 显示帮助然后退出 -v, --verbose # 显示BPF程序 -p [PID [PID ...]], --pid [PID [PID ...]] # 要观测的进程号,空格分隔 -m THRESHOLD, --threshold THRESHOLD # 只统计查询延迟比此阈值高的 -x PATH, --exe PATH # 数据库二进制文件的位置
示例:
# 使用sysbench在被观测数据库上执行update_index [root@liuan tools]# dbslower mysql -p `pidof mysqld` -m 2 Tracing database queries for pids 3350 slower than 2 ms... TIME(s) PID MS QUERY 1.765087 3350 2.996 UPDATE sbtest1 SET k=k+1 WHERE id=963 3.187147 3350 2.069 UPDATE sbtest1 SET k=k+1 WHERE id=628 5.945987 3350 2.171 UPDATE sbtest1 SET k=k+1 WHERE id=325 7.771761 3350 3.853 UPDATE sbtest1 SET k=k+1 WHERE id=5955. 使用*
bcc 基于 eBPF 开发(需要 Linux 3.15 及更高版本)。bcc 使用的大部分内容都需要 Linux 4.1 及更高版本。
"bcc.usdt.USDTException: failed to enable probe 'query__start'; a possible cause can be that the probe requires a pid to enable" 需要 MySQL 具备 Dtrace tracepoint。
热心网友 时间:2022-04-30 06:57
这个涉及到zabbix自定义监控项与MySQL主从同步两个技术,首先确保MySQL主从同步的前提下,在从库show slave status\G中找到“Seconds_Behind_Master”参数,改参数表示从库与主库同步的延迟间隔;热心网友 时间:2022-04-30 08:32
利用在slave上运行show slave status获取Slave_IO_Running和Slave_SQL_Running的值