Page 1 of 1

Check_mysql_health plugin gives unknown

PostPosted: Tue Jan 08, 2019 1:12 am
by farrukh
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.

Re: Check_mysql_health plugin gives unknown

PostPosted: Tue Jan 08, 2019 5:04 pm
by cdienger
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

Re: Check_mysql_health plugin gives unknown

PostPosted: Tue Jan 08, 2019 5:05 pm
by ssax
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.

Re: Check_mysql_health plugin gives unknown

PostPosted: Wed Jan 09, 2019 12:41 am
by farrukh
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 .

Re: Check_mysql_health plugin gives unknown

PostPosted: Wed Jan 09, 2019 4:31 pm
by ssax
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 $?

Re: Check_mysql_health plugin gives unknown

PostPosted: Thu Jan 10, 2019 1:03 am
by farrukh
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?

Re: Check_mysql_health plugin gives unknown

PostPosted: Fri Jan 11, 2019 4:16 pm
by scottwilkerson
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 $?