Check_mysql_health plugin gives unknown

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.
Locked
farrukh
Posts: 3
Joined: Tue Jan 08, 2019 12:56 am

Check_mysql_health plugin gives unknown

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Check_mysql_health plugin gives unknown

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_mysql_health plugin gives unknown

Post 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.
farrukh
Posts: 3
Joined: Tue Jan 08, 2019 12:56 am

Re: Check_mysql_health plugin gives unknown

Post 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 .
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_mysql_health plugin gives unknown

Post 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 $?
farrukh
Posts: 3
Joined: Tue Jan 08, 2019 12:56 am

Re: Check_mysql_health plugin gives unknown

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_mysql_health plugin gives unknown

Post 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 $?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked