Status is showing Unknown when monitoring MySQL 5.7

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.
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Status is showing Unknown when monitoring MySQL 5.7

Post by cssp »

Dear Team,

I tried to monitor MySQL 5.7 but the Status is Unknow and all are working as expected.

Nagios Core is installed in CentOS 7 with check_mysql_health plugin.

Command.cfg file

define command{
command_name check_mysql_health
command_line $USER1$/check_mysql_health -H $ARG4$ --username $ARG1$ --password $ARG2$ --port $ARG5$ --mode $ARG3$
}

localhost.cfg file

define service{
use local-service
host_name ubuntu
service_description MySQL slave-sql-running
check_command check_mysql_health!nagios!nagios!slave-sqlrunning!A.B.C.D!3306!
}

MySQL is installed in Ubuntu 16.04 with the check_mysql plugin.

User for nagios in MySQL
grant all privileges on *.* to 'nagios'@'Nagios-Server-IP-Address' identified by 'nagios';

Please let me know, What is wrong or need to do some extra tasks.

Thanks in advanced
Somnath Pandey
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by cdienger »

What are the results if you try running the command from the command line:

/usr/local/nagios/libexec/check_mysql_health -H A.B.C.D --username nagios --password nagios --port 3306 --mode slave-sqlrunning
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by cssp »

Hi cdienger,

Please check the Output(error) of the /usr/local/nagios/libexec/check_mysql_health -H A.B.C.D --username nagios --password nagios --port 3306 --mode slave-sql-running

[root@localhost objects]# /usr/local/nagios/libexec/check_mysql_health -H A.B.C.D --username nagios--password nagios --port 3306 --mode slave-sql-running
CRITICAL - unable to get replication info


Firewall disable on BOTH SYSTEM

Ubuntu Client

root@Ubuntu-MySQL-Server:~# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
tcp6 0 0 [::]:nrpe [::]:* LISTEN

CentOS Server

[root@localhost libexec]# netstat -at | grep nrpe
tcp6 0 0 [::]:nrpe [::]:* LISTEN

Thanks
Somnath Pandey
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by scottwilkerson »

Is the Ubuntu machine listening for remote connections on 3306?

Code: Select all

netstat -lnp|grep 3306
cssp wrote:MySQL is installed in Ubuntu 16.04 with the check_mysql plugin.
check_mysql_health doesn't use additional plugins, it connects directly to the server on 3306
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by cssp »

Hi Scottwilkerson,

root@Ubuntu-MySQL-Server:~# netstat -lnp | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1269/mysqld

Also, I can able to connect MySQL server with MySQL Workbench(which is installed on my Windows 10 machine).

Please help me with this issue.

Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by scottwilkerson »

Can you run any of the other modes?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by cssp »

Hi scottwilkerson,

You want to say with other user or something different?

cssp@Ubuntu-MySQL-Server:~$ netstat -lnp | grep 3306
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

Please check and update me.

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by scottwilkerson »

cssp wrote:You want to say with other user or something different?
With a different mode, such as the following (changing our A.B.C.D and the username/password)

Code: Select all

/usr/local/nagios/libexec/check_mysql_health -H A.B.C.D --username nagios --password nagios --port 3306 --mode uptime
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by cssp »

Yes, I already checked but the error is showing same.

CRITICAL - unable to get replication info
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Status is showing Unknown when monitoring MySQL 5.7

Post by scottwilkerson »

cssp wrote:Yes, I already checked but the error is showing same.

CRITICAL - unable to get replication info
It doesn't make sense that you are getting a replication info error when asking for uptime.

Are you sure this is the error you received?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked