加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_镇江站长网 (https://www.0511zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Centos 6.3下zabbix监控mysql数据库参数 - Linux系统

发布时间:2014-06-05 22:37:01 所属栏目:Linux 来源:站长网
导读:系统环境:centos6.3 x64 mysql: mysql-5.6.10 zabbix: zabbix-2.06 一.修改mysql客户端zabbix_agentd.conf配置: # vi /usr/local/etc/zabbix_agentd.conf 这

UserParameter=mysql.Threads_running,mysql -uroot -p123456  -e "show status like 'Threads_running';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_free_blocks,mysql -uroot -p123456  -e "show status like 'Qcache_free_blocks';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_free_memory,mysql -uroot -p123456  -e "show status like 'Qcache_free_memory';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_hits,mysql -uroot -p123456  -e "show status like 'Qcache_hits';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_inserts,mysql -uroot -p123456  -e "show status like 'Qcache_inserts';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_lowmem_prunes,mysql -uroot -p123456  -e "show status like 'Qcache_lowmem_prunes';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_not_cached,mysql -uroot -p123456  -e "show status like 'Qcache_not_cached';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_queries_in_cache,mysql -uroot -p123456  -e "show status like 'Qcache_queries_in_cache';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_total_blocks,mysql -uroot -p123456  -e "show status like 'Qcache_total_blocks';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Qcache_fragment_rate,echo $(mysql -uroot -p123456  -e "show status like 'Qcache_free_blocks';"| grep -v Value |awk '{print $2}') $(mysql -uroot -p123456  -e "show status like 'Qcache_total_blocks';"| grep -v Value |awk '{print $2}')| awk '{printf("%1.4fn",$1/$2*100)}'

UserParameter=mysql.Qcache_used_rate,echo $(mysql -uroot -p123456  -e "show variables like 'query_cache_size';"| grep -v Value |awk '{print $2}') $(mysql -uroot -p123456  -e "show status like 'Qcache_free_memory';"| grep -v Value |awk '{print $2}')| awk '{printf("%1.4fn",($1-$2)/$1*100)}'

UserParameter=mysql.Qcache_hits_rate,echo $(mysql -uroot -p123456  -e "show status like 'Qcache_hits';"| grep -v Value |awk '{print $2}') $(mysql -uroot -p123456  -e "show status like 'Qcache_inserts';"| grep -v Value |awk '{print $2}')| awk '{printf("%1.4fn",($1-$2)/$1*100)}'

UserParameter=mysql.Query_cache_limit,mysql -uroot -p123456  -e "show variables like 'query_cache_limit';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Query_cache_min_res_unit,mysql -uroot -p123456  -e "show variables like 'query_cache_min_res_unit';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Query_cache_size,mysql -uroot -p123456  -e "show variables like 'query_cache_size';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Sort_merge_passes,mysql -uroot -p123456  -e "show status like 'Sort_merge_passes';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Sort_range,mysql -uroot -p123456  -e "show status like 'Sort_range';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Sort_rows,mysql -uroot -p123456  -e "show status like 'Sort_rows';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Sort_scan,mysql -uroot -p123456  -e "show status like 'Sort_scan';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Handler_read_first,mysql -uroot -p123456  -e "show status like 'Handler_read_first';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Handler_read_key,mysql -uroot -p123456  -e "show status like 'Handler_read_key';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Handler_read_next,mysql -uroot -p123456  -e "show status like 'Handler_read_next';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Handler_read_prev,mysql -uroot -p123456  -e "show status like 'Handler_read_prev';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Handler_read_rnd,mysql -uroot -p123456  -e "show status like 'Handler_read_rnd';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Handler_read_rnd_next,mysql -uroot -p123456  -e "show status like 'Handler_read_rnd_next';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Com_select,mysql -uroot -p123456  -e "show status like 'com_select';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Com_insert,mysql -uroot -p123456  -e "show status like 'com_insert';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Com_insert_select,mysql -uroot -p123456  -e "show status like 'com_insert_select';"| grep -v Value |awk '{print $2}'

UserParameter=mysql.Com_update,mysql -uroot -p123456  -e "show status like 'com_update';"| grep -v Value |awk '{print $2}'

(编辑:应用网_镇江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!