默认mysql监控模版安装方法:
vim /usr/local/etc/zabbix_agentd.conf
UserParameter=mysql.ping,mysqladmin ping | grep -c alive
UserParameter=mysql.version,mysql -V
UserParameter=mysql.status[*],echo "show global status where Variable_name=‘$1‘;" | mysql -N -uroot | awk ‘{print $$2}‘
UserParameter=mysql.ping,/usr/local/mysql/bin/mysqladmin ping | grep -c alive
UserParameter=mysql.version,/usr/local/mysql/bin/mysql -V
UserParameter=mysql.status[*],echo "show global status where Variable_name=‘$1‘;" | /usr/local/mysql/bin/mysql -N -uroot | awk ‘{print $$2}‘
pkill zabbix
service zabbix_agentd start
默认的模版用的是mysqladmin 命令 启动mysql时,默认空密码,之后再改mysql的密码导致mysqladmin不能使用
报错:
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
mysqladmin: connect to server at ‘localhost‘ failed
error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: NO)‘
改回原来空密码即可
本文出自 “muzinan的技术博客” 博客,请务必保留此出处http://muzinan110.blog.51cto.com/684213/1559787
原文地址:http://muzinan110.blog.51cto.com/684213/1559787