加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_镇江站长网 (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.Com_replace,mysql -uroot -p123456  -e "show status like 'com_replace';"| grep -v Value |awk '{print $2}'

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

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

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

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

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

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

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

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

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

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

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

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

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

UserParameter=mysql.Engine_select,echo $(mysql -uroot -p123456  -e "show status like 'Table_locks_immediate';"| grep -v Value |awk '{print $2}') $(mysql -uroot -p123456  -e "show status like 'table_locks_waited';"| grep -v Value |awk '{print $2}')| awk '{printf("%5.4fn",$1/$2)}'

-------------------

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

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