Zabbix 3 中使用 Percona Monitoring Plugins 監控 MySQL

來源:互聯網
上載者:User

標籤:zabbix

1、安裝監控外掛程式

wget https://www.percona.com/downloads/percona-monitoring-plugins/percona-monitoring-plugins-1.1.7/binary/redhat/6/x86_64/percona-zabbix-templates-1.1.7-2.noarch.rpm

rpm -ivh percona-zabbix-templates-1.1.7-2.noarch.rpm 

yum install percona-zabbix-templates php php-mysql -y


2、修改zabbix agent設定檔

cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /usr/local/zabbix/etc/zabbix_agentd.conf.d/

vim /usr/local/zabbix/etc/zabbix_agentd.conf

Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/

killall -9 zabbix_agentd

/usr/local/zabbix/sbin/zabbix_agentd


3、建立mysql帳號

mysql> GRANT SELECT,PROCESS,SUPER,REPLICATION CLIENT ON *.* TO ‘zabbixmoniter‘@‘localhost‘ IDENTIFIED BY "123456";

mysql> flush privileges;


4、修改外掛程式設定檔

vim /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php

$mysql_user = ‘zabbixmoniter‘;

$mysql_pass = ‘123456‘;

$mysql_port = 3306;

$mysql_socket = ‘/tmp/mysql.sock‘;

5、建立zabbix使用者MySQL使用者帳號(監控slave用)

su - zabbix

vim ~/.my.cnf 

[client]

user = zabbixmoniter

password = 123456

socket = /tmp/mysql.sock


6、測試slave

su - zabbix

sh /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh running-slave


7、匯入模板

模板:

http://jaminzhang.github.io/soft-conf/Zabbix/zbx_percona_mysql_template.xml


參考博文:

http://www.ywnds.com/?p=6199

http://10880347.blog.51cto.com/346720/1932100

http://jaminzhang.github.io/monitoring/Monitoring-MySQL-using-Percona-Monitoring-Plugins-in-Zabbix/


Zabbix 3 中使用 Percona Monitoring Plugins 監控 MySQL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.