标签:
Zabbix自带的mysql监控模块
[root@Cagios zabbix-2.2.10]# cp conf/zabbix_agentd/userparameter_mysql.conf /usr/local/zabbix/etc/zabbix_agentd.conf.d/ [root@Cagios zabbix-2.2.10]# cd /usr/local/zabbix/etc/zabbix_agentd.conf.d/ [root@Cagios zabbix_agentd.conf.d]# vi userparameter_mysql.conf UserParameter=mysql.status[*],echo "show global status where Variable_name=‘$1‘;" | mysql -u zabbix_user -pzabbix_passwd -N | awk ‘{print $$2}‘ UserParameter=mysql.size[*],echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "data_free ";; esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] || echo " where table_schema=‘$1‘")$([[ "$2" = "all" || ! "$2" ]] || echo "and tabl e_name=‘$2‘");" | mysql -u zabbix_user -pzabbix_passwd -N UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin -uzabbix_user -pzabbix_passwd ping | grep -c alive UserParameter=mysql.version,mysql -V [root@Cagios ~]# vi /etc/zabbix/zabbix_agentd.conf Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/ [root@Cagios ~]# /etc/init.d/zabbix_agentd restart
标签:
原文地址:http://www.cnblogs.com/caoguo/p/5025435.html