码迷,mamicode.com
首页 > 数据库 > 详细

Zabbix自带的mysql监控模块

时间:2015-12-07 11:52:56      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:

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

 

 

技术分享

 

技术分享

Zabbix自带的mysql监控模块

标签:

原文地址:http://www.cnblogs.com/caoguo/p/5025435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!