Zabbix自带的mysql监控模块

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

 

 

 

posted @ 2015-12-07 10:42  ca0guo  阅读(680)  评论(0编辑  收藏  举报