Getting check_mysql error in Nagios core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Getting check_mysql error in Nagios core

Post by sandeep027 »

Hi Team,

I am trying to enable MySQL monitoring on of the host in Nagios core. but i am stucked with an error. can any one help on this.

I am facing error with check_mysql and Other plugins are running fine but only check_mysql is not working.

you can see the below output check_load and check_users are running fine. and check_mysql output

[root@lpdvmysqlstratax01 libexec]# /usr/local/nagios/libexec/check_load -w 6 -c 10
OK - load average: 0.00, 0.01, 0.05|load1=0.000;6.000;10.000;0; load5=0.010;6.000;10.000;0; load15=0.050;6.000;10.000;0;

[root@lpdvmysqlstratax01 libexec]# /usr/local/nagios/libexec/check_users -w 6 -c 10
USERS OK - 2 users currently logged in |users=2;6;10;0

[root@lpdvmysqlstratax01 libexec]# /usr/local/nagios/libexec/check_mysql -w 6 -c 10
/usr/local/nagios/libexec/check_mysql: relocation error: /usr/local/nagios/libexec/check_mysql: symbol mysql_init, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference

[root@lpdvmysqlstratax01 libexec]#


Can any one please help on this.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Getting check_mysql error in Nagios core

Post by cdienger »

What steps did you take to install the plugins? Were there any issues running the compile or make command?

Some OSes require additional packages for the mysql checks to work. https://support.nagios.com/kb/article.php?id=569 covers compiling and common prerequisites.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Getting check_mysql error in Nagios core

Post by sandeep027 »

Hi cdienger ,

Thank you so much, The link provided by you is very helpful , i am struggling from last 4 days to configure monitoring for one of the mysql host and i am facing errors in mysql 5.7 version only ,prevous version are looks good.

as per the link i tried the same process but in the middle when i am trying to install yum install -y mysql-devel mysql-libs , i am getting conflicts with latest mysql version 5.7 , can you please help on this how to overcome this one.

Please find the error as below.

Transaction Check Error:
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.23-1.el6.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.23-1.el6.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-common-5.7.23-1.el6.x86
file /usr/bin/mysql from install of mysql-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-client-5.7.23-1.el6.x86_64
file /usr/bin/mysqladmin from install of mysql-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-client-5.7.23-1.el6.x86_64
file /usr/bin/my_print_defaults from install of mysql-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-server-5.7.23-1.el6.x86_64
file /usr/share/man/man1/my_print_defaults.1.gz from install of mysql-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-server-5.7.23-1.el6.x86_64
file /etc/my.cnf from install of mysql-libs-5.1.73-8.0.1.el6_8.x86_64 conflicts with file from package mysql-community-server-5.7.23-1.el6.x86_64

Error Summary


Regards,
Sandeep.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Getting check_mysql error in Nagios core

Post by cdienger »

Is there a reason the mysql server is installed on the Nagios server? Is it using ndoutils? If there isn't a reason I would just uninstall it. If you do need it then I think you'll need to install the community versions of the packages:

yum install -y mysql-community-devel mysql-community-libs
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Getting check_mysql error in Nagios core

Post by sandeep027 »

Thanks for responding bro.. We are using Nagios core to monitor MySQL servers and all our MySQL servers are installed on Linux machines.

on those Linux machines we are configuring Nagios monitoring for all ourmysql servers and we have one dedicated server for Nagios. In Nagios GUI tool i am able to see all the parameter like check_load, check_disk,check_swap etc and check_mysql. But the problem is with in remote host and that too with check_mysql parameter only.

we have configured total 30 servers in Nagios core and recently two new hosts came into our support and we installled mysql version 5.7 and trying to configure Nagios, but i am facing these problems, may be the problem is with MySQL 5.7 version.but unable to resolve.

Please find the attached image of GUI tool...

Image

and in remote host i am getting this error
/check_mysql: relocation error: /usr/local/nagios/libexec/check_mysql: symbol mysql_init, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference

as per the link which you provided when i am trying those packages i am getting conflicts with mysql version.. i stucked here and unable to resolve.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Getting check_mysql error in Nagios core

Post by cdienger »

The image didn't make it through - please try attaching it again if the below doesn't help.

It sounds like you're probably using an agent like nrpe to run the check_mysql plugin that is installed on the remote database machine. Instead of doing this, try running the check_mysql plugin found on the Core machine and give it the information it would need to connect to the remote database. For example:

/usr/local/nagios/check_mysql -d <database> -h <remote_ip> -u <username> -p <password>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Getting check_mysql error in Nagios core

Post by mcapra »

What process/documentation did you follow when installing the Nagios plugins suite on this remote machine hosting your MySQL instance?

The Configure script used for compiling these plugins allows you to explicitly provide a path to the mysql client libraries (./configure --help for more info), which you may need to do in this case. Essentially, rebuild the plugins from source and provide the full path to your mysql libraries.

See the "Prerequisites - check_mysql check_mysql_query" section of the above documentation for more info. If not already installed, you may need to install the mysql-community-devel and mysql-community-libs packages, then recompile these plugins.
Former Nagios employee
https://www.mcapra.com/
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Getting check_mysql error in Nagios core

Post by sandeep027 »

cdienger wrote:The image didn't make it through - please try attaching it again if the below doesn't help.

It sounds like you're probably using an agent like nrpe to run the check_mysql plugin that is installed on the remote database machine. Instead of doing this, try running the check_mysql plugin found on the Core machine and give it the information it would need to connect to the remote database. For example:

/usr/local/nagios/check_mysql -d <database> -h <remote_ip> -u <username> -p <password>

As per above command i am able to connect from nagios host to remote host. but when i tired the same command from Remote host i am unable to connect.

[root@mysqlstrat01 ~]# /usr/local/nagios/libexec/check_mysql -H hostname -unagios -ppassword
/usr/local/nagios/libexec/check_mysql: relocation error: /usr/local/nagios/libexec/check_mysql: symbol mysql_init, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Getting check_mysql error in Nagios core

Post by sandeep027 »

mcapra wrote:What process/documentation did you follow when installing the Nagios plugins suite on this remote machine hosting your MySQL instance?

The Configure script used for compiling these plugins allows you to explicitly provide a path to the mysql client libraries (./configure --help for more info), which you may need to do in this case. Essentially, rebuild the plugins from source and provide the full path to your mysql libraries.

See the "Prerequisites - check_mysql check_mysql_query" section of the above documentation for more info. If not already installed, you may need to install the mysql-community-devel and mysql-community-libs packages, then recompile these plugins.
I have followed this documentation for installation.. previous we have 15 servers configured in Nagios core, after that i have configured 10 more servers in Nagios core. and now when i am trying to install Nagios plugins on 2 new hosts i am getting errors.

and as per the above link i have tried to install the mysql-community-devel and mysql-community-libs packages but i am getting conflicts with mysql latest version libs packages.
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Getting check_mysql error in Nagios core

Post by sandeep027 »

Sorry forgotted to paste the link and This is the link which i followed to install the nagios.


https://assets.nagios.com/downloads/nag ... e/NRPE.pdf

and this is the output of the host in GUI tool

http://tinypic.com/r/2dwamf6/9

Image
Locked