您好,登錄后才能下訂單哦!
由于本人在安裝mysql安裝包時(shí)yum默認(rèn)安裝為5.1,而我要安裝的mysql為5.6版本,因此從官網(wǎng)下載的rpm安裝包安裝的。但是在此服務(wù)器上安裝nagios時(shí),發(fā)現(xiàn)安裝的nagios-plugin插件中check_mysql沒有安裝,因此無法監(jiān)控mysql服務(wù)。通過查資料說是需要先安裝mysql-devel,然后在安裝插件才可以。但是mysql5.6環(huán)境下不管用,因此將該安裝過程記錄如下:
1. 默認(rèn)安裝為mysql5.6的rpm包環(huán)境:
(1)檢查當(dāng)前是否安裝了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
已經(jīng)安裝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
經(jīng)過查看過程,發(fā)現(xiàn)如上問題。
2. 在yum安裝mysql-devel的環(huán)境中如下:
(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
通過對(duì)比發(fā)現(xiàn),rpm安裝的mysql5.6版本沒有生成如上的接口文件,導(dǎo)致編譯安裝nagios-plugin時(shí)無法安裝check_mysql。
解決方法:
目前只能先卸載rpm包所安裝的mysql-devel,然后在yum安裝。還沒有找到rpm包安裝解決的方法。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。