欢迎来到天天文库
浏览记录
ID:8806643
大小:58.08 KB
页数:4页
时间:2018-04-08
《nagios监控mysql5.6.17-1》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、在mysql服务器安装check_mysql_health首先在mysql被监控机安装nagios-plugins以及nrpe-2.15,过程不在详细描述。安装check_mysql_healthtar zxvf check_mysql_health-2.1.1.tar.gz -C ../software/./configure--prefix=/usr/local/nagios/--with-mysql=/var/lib/mysql/make&&makeinstallyuminstallperl-DBIperl-DB
2、D-MySQL–y这两个必须安装否则运行check_mysql_health命令的时候,会报错在安装perl-DBD-MySQL的过程中遇到了一个问题在装好mysql的机器里,没有mysql-libs包,在yum安装的时候,会报错,因为mysql版本为5.6.17-1,但是yum装的mysql-libs版本为mysql-libs-5.1.73-3.el6_5.x86_64,我采取了强制安装的方法yuminstall-yyum-downloadonly安装yum下载功yuminstallperl-DBD-MySQL-y-
3、-downloadonly--downloaddir=/opt下载perl-DBD-MySQL的依赖包rpm-ivhmysql-libs-5.1.73-3.el6_5.x86_64.rpm--force–nodeps强制安装mysql-libsrpm-ivhperl-DBD-MySQL-4.013-3.el6.x86_64.rpm--force–nodeps强制安装perl-DBD因为mysql的机器开启了防火墙,mysql用的是3307端口,所以在防火墙中打开3307端口iptables-IINPUT-ptcp--d
4、port3307-jACCEPT防火墙打开3307端口/etc/init.d/iptablessave保存防火墙设置/etc/init.d/iptablesrestart重启防火墙测试命令/usr/local/nagios/libexec/check_mysql_health-hostname127.0.0.1-usernamenagios-password123456-port3307-modethreads-connectedOK-1clientconnectionthreads
5、threads_connected
6、=1;10;20-hostname被监控端(数据库所在机器)的地址-username要监控的database用户的名称-database要监控的database的名称默认为information_schema-password要监控的databases密码-port数据库端口如不写就是默认3306-mode后边跟的是要监控的内容贴出来官方给的可以监控的数据themodeoftheplugin.selectoneofthefollowingkeywords:connection-time(Timetoconnecttot
7、heserver)uptime(Timetheserverisrunning)threads-connected(Numberofcurrentlyopenconnections)threadcache-hitrate(Hitrateofthethread-cache)threads-created(Numberofthreadscreatedpersec)threads-running(Numberofcurrentlyrunningthreads)threads-cached(Numberofcurrentlyca
8、chedthreads)connects-aborted(Numberofabortedconnectionspersec)clients-aborted(Numberofabortedconnections(becausetheclientdied)persec)slave-lag(Secondsbehindmaster)slave-io-running(Slaveiorunning:Yes)slave-sql-running(Slavesqlrunning:Yes)qcache-hitrate(Querycache
9、hitrate)qcache-lowmem-prunes(Querycacheentriesprunedbecauseoflowmemory)keycache-hitrate(MyISAMkeycachehitrate)bufferpool-hitrate(InnoDBbufferpoolhitrate)bufferpool-wa
此文档下载收益归作者所有