mysql -e”GRANT USAGE ON *.* TO ‘zabbix’@’127.0.0.1’ IDENTIFIED BY ‘123456’”;
mysql -e”GRANT USAGE ON *.* TO ‘zabbix’@’localhost’ IDENTIFIED BY ‘123456’”;
mysql -e”flush privileges”
mysql -uzabbix -p123456 -e”status”
Include=/etc/zabbix/zabbix_agentd
vi /etc/zabbix/zabbix_agentd/mysql.conf
UserParameter=mysql.ping[*],(test -f /usr/bin/mysqladmin && mysqladmin -u zabbix -p123456 ping | grep alive | wc -l)
service zabbix-agent restart