标签:
zabbix mpm监控mysql是一个蛮不错的监控模块,不过最近官网已经不叫mpm了,而是叫fpmmm,理由为:
fpmmm is the successor of mpm. mpm was renamed to fpmmm because of the naming conflict with the Apache Multi-Processing Modules (MPM).
下面开始安装:
第一步:下载fpmmm模块:
http://www.fromdual.com/download-performance-monitor
点击Get the Latest release.
选择相应的版本,然后会让你填写一些信息,下载链接它会通过发邮件给你。
第二步:安装fpmmm
以下以Centos6为例说明:
yum install php-cli php-process php-mysqli php-memcached php-posix
cat << _EOF >/etc/php.d/fpmmm.ini
variables_order = "EGPCS"
_EOF
官网有设置成欧洲的时间,没有必要,在/etc/php.ini设置成中国时区就好了。
tar -zxvf fpmmm-0.10.5.tar.gz -C /usr/local/zabbix/
cd /usr/local/zabbix/
mv fpmmm-0.10.5 fpmmm
cd /usr/local/zabbix/fpmmm/tpl
cp fpmmm.conf.template fpmmm.conf
chown -R zabbix. /usr/local/zabbix
第三步:修改参数
fpmmm.conf,主要修改下面的参数:
# Information for MySQL connections:
Username = user_fpmmm
Password = 123456
MysqlHost = 127.0.0.1
MysqlPort = 3307
# Zabbix Server IP address
ZabbixServer = 192.168.1.240
# Here you could add a random name of your MySQL/MariaDB instance
[gl.mysql.3307] # This MUST match Hostname in Zabbix!
Type = mysqld
MysqlPort = 3307
Modules = process mysql myisam innodb master slave security
PidFile = /home/mysql/I3307/mysql.pid
第四步:创建监控的mysql用户
CREATE USER ‘user_fpmmm‘@‘127.0.0.1‘ IDENTIFIED BY ‘123456‘;
GRANT PROCESS ON *.* TO ‘user_fpmmm‘@‘127.0.0.1‘;
GRANT REPLICATION CLIENT ON *.* TO ‘user_fpmmm‘@‘127.0.0.1‘;
GRANT REPLICATION SLAVE ON *.* TO ‘user_fpmmm‘@‘127.0.0.1‘; #这一条官网没有,不过不加的话会在log里面提醒你需要,主要为了show slave hosts
GRANT SELECT ON mysql.user TO ‘user_fpmmm‘@‘127.0.0.1‘;
第四步:测试验证:
[root@localhost zabbix]# /usr/local/zabbix/fpmmm/bin/fpmmm --config=/usr/local/zabbix/fpmmm/tpl/fpmmm.conf
1
返回1代表有希望,但不代表成功,还得看fpmmm的log日志
cat /tmp/fpmmm/fpmmm.log
如果log文件也没有什么异常的话,那说明成功了。
ps:
官网详细安装过程:http://www.fromdual.com/fpmmm-installation-guide
fpmmm(mpm)监控mysql模块安装
标签:
原文地址:http://www.cnblogs.com/zejin2008/p/5416441.html