/etc/zabbix/zabbix_agentd.d、userparameter_mysql.conf
UserParameter=mysql.version,mysql -V
UserParameter=mysql.status[*],/etc/zabbix/scripts/chk_mysql.sh $1UserParameter=mysql.ping,mysqladmin -uzabbix -p123456 -P3306 -h10.0.0.6 ping | grep -c alive
mysql客户端监控脚本
mkdir /etc/zabbix/scripts/touch/etc/zabbix/scripts/chk_mysql.sh
chmod u+x /etc/zabbix/scripts/chk_mysql.sh
chown-R zabbix.zabbix /etc/zabbix/scripts/chk_mysql.sh/etc/zabbix/scripts/chk_mysql.sh
#!/bin/sh
#-------------------------------------------------------------------------------# Author: kk
# Email: hao1cheng@163.com
MYSQL_PWD=‘123456‘MYSQL_HOST=‘127.0.0.1‘MYSQL_PORT=‘3306‘echo"Please input one arguement:"ficase $1 inecho $result
;;
Com_update)
echo $result
;;
Slow_queries)
;;
Com_select)
ech