标签:back ext 获取 grep $0 err ali res 运行
vim /usr/local/scripts/mysql_status.sh${CONNECTION} status 2>/dev/null |awk ‘{print $2}‘
${CONNECTION} status 2>/dev/null |awk ‘{print $6}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_update" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Slow_queries" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_select" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_rollback" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_insert" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_delete" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_commit" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Bytes_sent" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Bytes_received" |awk ‘{print $4}‘
${CONNECTION} extended-status 2>/dev/null |grep -w "Com_begin" |awk ‘{print $4}‘
vim /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
#获取MySQL性能指标,这个是上一步编辑好的脚本
UserParameter=mysql.status[*],/usr/local/scripts/mysql_status.sh $1
#获取MySQL运行状态
UserParameter=mysql.ping,mysqladmin -u root -h localhost -p123457 ping 2>/dev/null | grep -c alive
#获取MySQL版本
UserParameter=mysql.version,mysql -V
标签:back ext 获取 grep $0 err ali res 运行
原文地址:https://blog.51cto.com/13293070/2529875