Check_mysql_health plugin gives unknown

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Check_mysql_health plugin gives unknown

Postby farrukh » Tue Jan 08, 2019 1:12 am

Hi,
I have use check_mysql_health plugin and i want to read the output with nrpe

so i use this check_nrpe!check_mysql_health

but it gives unknow$mode if i run the command on terminal it gives below output:
/usr/lib/nagios/plugins/check_mysql_health -v --hostname localhost --user root --password 'nagios#123' --mode uptime
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_IN"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
OK - database is up since 4227 minutes
database is up since 4227 minutes | 'uptime'=4227;10:;5:;;

Please help.
farrukh
 
Posts: 3
Joined: Tue Jan 08, 2019 12:56 am

Re: Check_mysql_health plugin gives unknown

Postby cdienger » Tue Jan 08, 2019 5:04 pm

What OS is this on? It looks like you may need to set some environment variables or install local info:

https://stackoverflow.com/questions/249 ... l/20627476

You can also try working around it by running it like:

LANG=C /usr/lib/nagios/plugins/check_mysql_health -v --hostname localhost --user root --password 'nagios#123' --mode uptime
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 4253
Joined: Tue Feb 07, 2017 11:26 am

Re: Check_mysql_health plugin gives unknown

Postby ssax » Tue Jan 08, 2019 5:05 pm

What is the output of this command on the remote server:

Code: Select all
locale


What is the full output of these commands?

Code: Select all
su - nagios
LANGUAGE=C LANG=C LC_ALL=C /usr/lib/nagios/plugins/check_mysql_health -v --hostname localhost --user root --password 'nagios#123' --mode uptime


Please send me your nrpe.cfg from the remote system as well.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4866
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_mysql_health plugin gives unknown

Postby farrukh » Wed Jan 09, 2019 12:41 am

Output of locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_IN
LANGUAGE=
LC_CTYPE="en_IN"
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=
==========================================================
LANGUAGE=C LC_ALL=C /usr/lib/nagios/plugins/check_mysql_health -v --hostname localhost --user root --password 'nagios#123' --mode uptime
OK - database is up since 5639 minutes
database is up since 5639 minutes | 'uptime'=5639;10:;5:;;
===========================================================
nrpe config

command[check_mysql_health]=/usr/lib/nagios/plugins/check_mysql_health --hostname localhost --user root --password 'nagios#123' --mode uptime
===========================================================
My issue is that i want to use the output of this check_mysql_health using nrpe
define service{
use local-service
host_name localhost
service_description mysql-uptime
check_command check_nrpe!check_mysql_health
}
by using above i am getting unknown on nagios GUI.
Please help.

I am using Ubuntu on both the ends .
farrukh
 
Posts: 3
Joined: Tue Jan 08, 2019 12:56 am

Re: Check_mysql_health plugin gives unknown

Postby ssax » Wed Jan 09, 2019 4:31 pm

Try changing your nrpe.cfg from:

Code: Select all
command[check_mysql_health]=/usr/lib/nagios/plugins/check_mysql_health --hostname localhost --user root --password 'nagios#123' --mode


To:

Code: Select all
command[check_mysql_health]=LANGUAGE=C LC_ALL=C /usr/lib/nagios/plugins/check_mysql_health --hostname localhost --user root --password 'nagios#123' --mode


Then apply configuration and test to see if it's working now.

Then run these commands on the remote host and let me know the full output:

Code: Select all
su - nagios
LANGUAGE=C LC_ALL=C /usr/lib/nagios/plugins/check_mysql_health --hostname localhost --user root --password 'nagios#123' --mode uptime
echo $?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4866
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_mysql_health plugin gives unknown

Postby farrukh » Thu Jan 10, 2019 1:03 am

I think nagios nrpe is not able to login because at DB server i disabled remote login and MYSQL is bind with localhost. I just thought i can read output with nrpe . Is this is the possible issue?
farrukh
 
Posts: 3
Joined: Tue Jan 08, 2019 12:56 am

Re: Check_mysql_health plugin gives unknown

Postby scottwilkerson » Fri Jan 11, 2019 4:16 pm

farrukh wrote:I think nagios nrpe is not able to login because at DB server i disabled remote login and MYSQL is bind with localhost. I just thought i can read output with nrpe . Is this is the possible issue?


Could you run the following on the remote server?
Code: Select all
su - nagios
LANGUAGE=C LC_ALL=C /usr/lib/nagios/plugins/check_mysql_health --hostname localhost --user root --password 'nagios#123' --mode uptime
echo $?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 18223
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Community Support

Who is online

Users browsing this forum: Azampay, G_Deshpande, Google [Bot] and 30 guests