189 8069 5689

nagios无法安装check_mysql插件的问题-创新互联

由于本人在安装mysql安装包时yum默认安装为5.1,而我要安装的mysql为5.6版本,因此从官网下载的rpm安装包安装的。但是在此服务器上安装nagios时,发现安装的nagios-plugin插件中check_mysql没有安装,因此无法监控mysql服务。通过查资料说是需要先安装mysql-devel,然后在安装插件才可以。但是mysql5.6环境下不管用,因此将该安装过程记录如下:

我们提供的服务有:网站设计、成都网站建设、微信公众号开发、网站优化、网站认证、柳州ssl等。为成百上千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的柳州网站制作公司

1. 默认安装为mysql5.6的rpm包环境:

(1)检查当前是否安装了mysql-devel:

$ rpm -qa |grep -i mysql

MySQL-client-5.6.27-1.el6.x86_64

php-mysql-5.3.3-46.el6_6.x86_64

MySQL-server-5.6.27-1.el6.x86_64

MySQL-shared-compat-5.6.27-1.el6.x86_64

MySQL-devel-5.6.27-1.el6.x86_64

已经安装MySQL-devel-5.6.27-1.el6.x86_64.

(2)重新编译安装nagios-plugin:

$ ./configure --with-nagios-user=nagios --with-nagios-group=nagios

.......

checking for mysql_config... /usr/bin/mysql_config

checking for mysql_init in -lmysqlclient... no

configure: WARNING: Skipping mysql plugin

configure: WARNING: install mysql client libs to compile this plugin (see REQUIREMENTS).

checking utmpx.h usability... yes

.......

--with-apt-get-command:

       --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s

        --with-ping-command: /bin/ping -n -U -w %d -c %d %s

            --with-ipv6: yes

           --with-mysql: no

          --with-openssl: yes

           --with-gnutls: no

        --enable-extra-opts: yes

            --with-perl: /usr/bin/perl

       --enable-perl-modules: no

           --with-cgiurl: /nagios/cgi-bin

        --with-trusted-path: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

          --enable-libtap: no

经过查看过程,发现如上问题。

2. 在yum安装mysql-devel的环境中如下:

(1)yum安装mysql-devel:

$ sudo yum -y install mysql-devel

..........

.........

已安装:

 mysql-devel.x86_64 0:5.1.73-5.el6_6

作为依赖被安装:

 mysql.x86_64 0:5.1.73-5.el6_6              mysql-libs.x86_64 0:5.1.73-5.el6_6

完毕!

(2)编译安装nagios-plugin插件:

$ ./configure --with-nagios-user=nagios --with-nagios-group=nagios

...........

checking for mysql_config... /usr/bin/mysql_config

checking for mysql_init in -lmysqlclient... yes

checking utmpx.h usability... yes

.....................

-with-apt-get-command:

       --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s

        --with-ping-command: /bin/ping -n -U -w %d -c %d %s

            --with-ipv6: yes

           --with-mysql: /usr/bin/mysql_config

          --with-openssl: yes

           --with-gnutls: no

        --enable-extra-opts: yes

            --with-perl: /usr/bin/perl

       --enable-perl-modules: no

           --with-cgiurl: /nagios/cgi-bin

        --with-trusted-path: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

          --enable-libtap: no

(3)搜索一下mysqlclient的位置:

#updatedb

# locate mysqlclient

/soft/nagios-plugins-2.1.1/m4/np_mysqlclient.m4

/usr/lib/mysql/libmysqlclient.a

/usr/lib/mysql/libmysqlclient.so

/usr/lib/mysql/libmysqlclient.so.15

/usr/lib/mysql/libmysqlclient.so.15.0.0

/usr/lib/mysql/libmysqlclient_r.a

/usr/lib/mysql/libmysqlclient_r.so

/usr/lib/mysql/libmysqlclient_r.so.15

/usr/lib/mysql/libmysqlclient_r.so.15.0.0

/usr/lib64/mysql/libmysqlclient.a

/usr/lib64/mysql/libmysqlclient.so

/usr/lib64/mysql/libmysqlclient.so.15

/usr/lib64/mysql/libmysqlclient.so.15.0.0

/usr/lib64/mysql/libmysqlclient_r.a

/usr/lib64/mysql/libmysqlclient_r.so

/usr/lib64/mysql/libmysqlclient_r.so.15

/usr/lib64/mysql/libmysqlclient_r.so.15.0.0

通过对比发现,rpm安装的mysql5.6版本没有生成如上的接口文件,导致编译安装nagios-plugin时无法安装check_mysql。

解决方法:

目前只能先卸载rpm包所安装的mysql-devel,然后在yum安装。还没有找到rpm包安装解决的方法。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


新闻标题:nagios无法安装check_mysql插件的问题-创新互联
文章地址:http://cdxtjz.cn/article/dieohh.html

其他资讯