zabbix公司專屬應用程式之監控3306連接埠的mysql

來源:互聯網
上載者:User

本次介紹監控固定3306連接埠的mysql,下面是方法

一、用戶端

1.到/usr/loca/zabbix/conf/zabbix_agentd.conf裡添加

UserParameter=mysql_3306[*],mysql -h localhost –P 3306 -uzabbix -pzabbix -e "show global status"|grep "\<$1\>"|cut –f2

如果你mysql的socket不是預設的,請在這個參數下加上-S後面是你的socket地址。

2.在mysql資料庫裡給zabbix使用者授權

GRANT PROCESS ON *.* TO 'zabbix'@'localhost' identified BY 'zabbix';Flush privileges;

3.重啟zabbix agent服務

ps -ef|grep zabbix|grep -v grep|awk '{print $2}'|xargs kill -9/usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/conf/zabbix_agentd.conf

二、服務端

1.在zabbix的web介面裡串連監控mysql模板

在web裡選擇配置-模板

然後選擇匯入

然後把之前下載的zabbix_mysql_3306.xml文檔匯入。

然後在選擇主機加入這個模板即可。

2.以上是面對mysql連接埠不修改,正常為3306連接埠。

如果是多連接埠或者不為3306連接埠的話,可以對模板進行修改,

可以sed -i ‘s/3306/你修改的連接埠/g’ zabbix_mysql_3306.xml

然後在重新匯入到zabbix就可以監控多連接埠或非3306連接埠

同時在zabbix_agentd.conf裡把UserParameter裡的3306改成你需要的連接埠

三、

1、Mysql Bytes_sent Bytes_received

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z45951-0.jpg" title="13.jpg" alt="094531690.jpg" />

2、Mysql Com

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z45b6-1.jpg" title="13.jpg" alt="094629640.jpg" />

3、Mysql Connections

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z45929-2.jpg" title="13.jpg" alt="094714798.jpg" />

4、Mysql Create tmp

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z4FJ-3.jpg" title="13.jpg" alt="094803848.jpg" />

5、Mysql Innodb

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z41953-4.jpg" title="13.jpg" alt="094843967.jpg" />

6、Mysql Key

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z44959-5.jpg" title="13.jpg" alt="094928204.jpg" />

7、Mysql Port status

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z41506-6.jpg" title="13.jpg" alt="095008136.jpg" />

8、Mysql Qcache

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z4J63-7.jpg" title="13.jpg" alt="095100498.jpg" />

9、Mysql Queries and Questions

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z42F5-8.jpg" title="13.jpg" alt="095141350.jpg" />

10、Mysql Slow

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z43551-9.jpg" title="13.jpg" alt="095216921.jpg" />

11、Mysql Sort

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z43029-10.jpg" title="13.jpg" alt="095250556.jpg" />

12、Mysql Uptime

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/140101/002Z46320-11.jpg" title="13.jpg" alt="095326919.jpg" />

本文出自 “吟—技術交流” 部落格,請務必保留此出處http://dl528888.blog.51cto.com/2382721/1346590

相關文章

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.