CentOS 6.3下Zabbix监控MySQL数据库参数(3)

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.4f\n",$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.4f\n",$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.4f\n",$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.4f\n",$1/$2)}'

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/739eb9297bf4277b95d3ba31eb0aa88e.html