-
MPM Agent配置
创建MySQL监控用户mpm:
mysql> create user 'mpm'@'127.0.0.1' identified by '123456'; mysql> grant process, replication client on *.* to 'mpm'@'127.0.0.1'; mysql> flush privileges;
配置MPM Agent:
# cd /usr/local/mysql_performance_monitor-agent/etc # cp FromDualMySQLagent.conf.template FromDualMySQLagent.conf # mkdir -p /var/log/zabbix # mkdir -p /var/log/zabbix/cache # touch /var/log/zabbix/FromDualMySQLagent.log # chown -R zabbix:zabbix /var/log/zabbix # chmod o+r /var/run/mysqld/mysqld.pid # vi FromDualMySQLagent.conf # cat FromDualMySQLagent.conf
[default] # Type of section: # mysqld for a normal MySQL database # ndbd for a MySQL cluster Type = mysqld # Debug levels are: # 1 is logging only errors # 2 is logging errors and warnings (this is the default) # 3 logs some informations messages as well # 4 logs everything (for debugging purposes only) Debug = 2 LogFile = /var/log/zabbix/FromDualMySQLagent.log # Directory where the Cache files should be written to: CacheFileBase = /var/log/zabbix/cache/FromDualAgentCache # If you agent is not located in the same time zone as your server # TimeShift = +0.0 # Information for MySQL connections: Username = mpm Password = 123456 MysqlHost = 127.0.0.1 MysqlPort = 3306 # Zabbix Server IP address ZabbixServer = 192.168.1.190 # If section is disabled Disabled = false # Possible modules for databases are: # process mysql myisam aria innodb pbxt ndb master slave drbd galera memcache # Possible modules for servers are: # mpm server # Usual modules are Modules = process mysql myisam innodb # Special parameter which is used for module ndb and process ClusterLog = /var/lib/mysql-cluster/ndb_1_cluster.log # MySQL Pid file, need read permission for zabbix user PidFile = /var/run/mysqld/mysqld.pid [db_server] Type = mysqld Modules = mpm server # All MySQL databases here # Try to avoid section names with spaces! [192.168.1.191_MySQL_5.5.29] # This MUST match Hostname in Zabbix! Type = mysqld MysqlPort = 3306 Modules = process mysql myisam innodb slave PidFile = /var/run/mysqld/mysqld.pid Debug = 1
注:这里监控的MySQL Server是MySQL主从复制的中的Slave机器.
- 开始监控MySQL
Zabbix Web UI创建host (192.168.1.191_MySQL_5.5.29): -


重启Zabbix Agentd:
# /etc/init.d/zabbix_agentd restart
Zabbix Web UI的”Monitoring”->”Latest data”可以查看监控情况:

推荐阅读:
CentOS 6.3下Zabbix安装部署 http://www.linuxidc.com/Linux/2013-05/83786.htm
Zabbix分布式监控系统实践 http://www.linuxidc.com/Linux/2013-06/85758.htm
CentOS 6.3下Zabbix监控apache server-status http://www.linuxidc.com/Linux/2013-05/84740.htm
CentOS 6.3下Zabbix监控MySQL数据库参数 http://www.linuxidc.com/Linux/2013-05/84800.htm
