Centos 6.3下zabbix监控mysql数据库参数 - Linux系统
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}' (编辑:应用网_镇江站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |