cacti監控 之 mysql connections

來源:互聯網
上載者:User

標籤:cacti   監控mysql線程   cacti監控mysql   

cacti監控mysql的線程,並發,串連情況,緩衝使用方式,查詢方式等等

wgets https://www.percona.com/downloads/percona-monitoring-plugins/1.1.6/percona-monitoring-plugins-1.1.6.tar.gz                                                                                      (截止2017.1.4最新版本1.1.7)

下載解壓後只取兩個檔案

1、  PHP採集指令碼:

cp percona-monitoring-plugins-1.1.6/cacti/scripts/ss_get_mysql_stats.php  /var/www/html/cacti/scripts/

chmod +x ss_get_mysql_stats.php

 

在被監控端mysql伺服器上授權

mysql> grant process,super on *.* to‘cacti‘@‘%‘ identified by ‘cacti‘;

注意:MySQL 5.1.23和更舊版本中採集InnoDB圖形需要SUPER許可權。
在MySQL 5.1.24及更高版本中,所需的許可權是PROCESS而不是SUPER。(官方)

 

按需修改:vim ss_get_mysql_stats.php

650) this.width=650;" src="https://s3.51cto.com/wyfs02/M00/8C/E9/wKioL1h91c3iSDYuAAANSJY_7Zs937.png" title="1.png" alt="wKioL1h91c3iSDYuAAANSJY_7Zs937.png" />

建立Cache目錄,預設的/tmp cacti沒有許可權訪問

mkdir /var/www/html/cacti/tmp 

chown -R cacti.cacti  /var/www/html/cacti/tmp  
chmod 777 -R  /var/www/html/cacti/tmp 

650) this.width=650;" src="https://s3.51cto.com/wyfs02/M01/8C/E9/wKioL1h91fmAs6ZZAADAuY6GYac928.png" title="2.png" alt="wKioL1h91fmAs6ZZAADAuY6GYac928.png" />

 

2、Cacti視圖模板檔案(web管理端import該模板):

650) this.width=650;" src="https://s3.51cto.com/wyfs02/M01/8C/E9/wKioL1h91siwKYvKAAF_5MOXP8w243.png" title="3.png" alt="wKioL1h91siwKYvKAAF_5MOXP8w243.png" />

選擇該xml檔案:percona-monitoring-plugins-1.1.6/cacti/templates/cacti_host_template_percona_mysql_server_ht_0.8.6i-sver1.1.6.xml    


匯入後添加裝置選擇percona mysql模板,選擇各個監控項,具體含義自己按需比對吧,最底下有連結
上兩張圖饞饞、、、

myisam和innodb都有專用監控視圖,N多,自己選需要的

650) this.width=650;" src="https://s3.51cto.com/wyfs02/M00/8C/EE/wKiom1h96hiTPtXYAABzmyxoUo4254.png-wh_500x0-wm_3-wmp_4-s_3013845012.png" style="float:none;" title="1.png" alt="wKiom1h96hiTPtXYAABzmyxoUo4254.png-wh_50" />

650) this.width=650;" src="https://s4.51cto.com/wyfs02/M00/8C/EE/wKiom1h96hnDLnSRAABy-vuPKZ0413.png-wh_500x0-wm_3-wmp_4-s_2703253171.png" style="float:none;" title="2.png" alt="wKiom1h96hnDLnSRAABy-vuPKZ0413.png-wh_50" />

650) this.width=650;" src="https://s1.51cto.com/wyfs02/M00/8C/EA/wKioL1h96hqBxuglAADmeVrW9_w120.png-wh_500x0-wm_3-wmp_4-s_2150719611.png" style="float:none;" title="3.png" alt="wKioL1h96hqBxuglAADmeVrW9_w120.png-wh_50" />


樣本圖和監控項比對說明:

https://www.percona.com/doc/percona-monitoring-plugins/LATEST/cacti/mysql-templates.html


現有的監控是nagios+cacti做了整合,所以別問我為什麼不直接用zabbix,一個字 麻煩、、、



本文出自 “linux_wei” 部落格,請務必保留此出處http://linuxww.blog.51cto.com/11418425/1892701

cacti監控 之 mysql connections

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.