Problems with check_mysql

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.
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Problems with check_mysql

Post by nathanplatt »

Okay i've made progress, now i'm getting from the cpanel server;

Code: Select all

cpanel - MYSQL Load
	
	CRITICAL 	07-26-2018 22:14:49 	2d 12h 17m 7s 	3/3 	Access denied for user 'nagios'@'cpc82787-midd19-2-0-cust603.11-1.cable.virginm.net' (using password: NO) 

cpanel nameserver MYSQL Load
	
	CRITICAL 	07-26-2018 22:10:45 	2d 12h 22m 41s 	3/3 	(Service check timed out after 60.02 seconds) 
Ideas?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with check_mysql

Post by scottwilkerson »

looks like you didn't add the user/password to the command.

What is the command you ran?

In our example earlier we showed

Code: Select all

/usr/local/nagios/libexec/check_mysql -H x.x.x.x -u <username> -p <password> -d <dbname>
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Problems with check_mysql

Post by nathanplatt »

We're making progress now i'm just getting a few different errors;

Code: Select all

Host '82.16.34.92' is not allowed to connect to this MariaDB server 
Can't connect to MySQL server on '31.22.2.87' (111) 
Can't connect to MySQL server on '31.22.2.86' (113)
Access denied for user 'nagios'@'cpc82787-midd19-2-0-cust603.11-1.cable.virginm.net' (using password: NO) 
The Access denied is the cpanel server
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Problems with check_mysql

Post by nathanplatt »

scottwilkerson wrote:looks like you didn't add the user/password to the command.

What is the command you ran?

In our example earlier we showed

Code: Select all

/usr/local/nagios/libexec/check_mysql -H x.x.x.x -u <username> -p <password> -d <dbname>
I just want to check if mysql is running rather than a particular database
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with check_mysql

Post by scottwilkerson »

With this plugin you would still need to enter a username that has permissions to access a database from your host, even if it is to just check it is running.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Problems with check_mysql

Post by nathanplatt »

Can i pass the variables in the ARG section from the gui something like -u, -p?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with check_mysql

Post by scottwilkerson »

nathanplatt wrote:Can i pass the variables in the ARG section from the gui something like -u, -p?
Yes, but you should make it work form the command line first to make sure everything is working, then you can proceed to setup the command with passing args in on your service config
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked