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官网
下面开始安装:
- 下载fpmmm模块:
www.fromdual.com/download-pe…
点击Get theLatest release.
选择相应的版本,然后会让你填写一些信息,下载链接它会通过发邮件给你。
- 安装zabbix-sender及php依赖
# zabbix-sender安装
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
yum install zabbix-sender
yum -y install php-cli php-process php-mysqli
- fpmmm监控时区设置
cat << _EOF >/etc/php.d/fpmmm.ini
variables_order = "EGPCS"
date.timezone = 'Europe/Zurich'
_EOF
- 下载fpmmm
wget https://support.fromdual.com/admin/download/fpmmm-0.10.6.tar.gz
tar zxvf fpmmm-0.10.6.tar.gz -C /data/program/zabbix_agent/
- zabbix_agentd.conf配置增加
PidFile=/run/zabbix_agentd.pid
LogFile=/var/log/zabbix_agentd.log
LogFileSize=0
Server=10.48.6.173
ListenPort=10050
StartAgents=1
HostnameItem=system.hostname
ServerActive=10.48.6.173
AllowRoot=1
RefreshActiveChecks=120
BufferSize=100
Timeout=10
UnsafeUserParameters=1
UserParameter=FromDual.MySQL.check,/data/program/zabbix_agent/fpmmm/bin/fpmmm --config=/data/program/zabbix_agent/fpmmm/tpl/fpmmm.conf
- mysql数据库所需要的权限:
grant process on *.* to 'mpm'@'127.0.0.1' identified by '123456';
grant replication client on *.* to 'mpm'@'127.0.0.1';
grant replication slave on *.* to 'mpm'@'127.0.0.1';
grant select on mysql.user to 'mpm'@'127.0.0.1';
flush privileges;
- /data/program/zabbix_agent/fpmmm/tpl/fpmmm.conf配置如下
[default]
Type = mysqld
Debug = 2
LogFile = /var/log/zabbix/FromDualMySQLagent.log
CacheFileBase = /var/log/zabbix/cache/FromDualAgentCache
Username = mpm
Password = 123456
MysqlHost = 127.0.0.1
MysqlPort = 3306
ZabbixServer = 10.48.6.173
Disabled = false
[mysql-db-master]#必须和zabbix上添加的名称一致
Type = mysqld
MysqlPort = 3306
Modules = process mysql server innodb
PidFile = /data/mysql/3306/data/mysqld.pid
- 添加计划任务:
* * * * * /data/program/zabbix_agent/fpmmm/bin/fpmmm --config=/data/program/zabbix_agent/fpmmm/tpl/fpmmm.conf
发表回复
要发表评论,您必须先登录。