How to monitor MySQL in Nagios with enabled networking.....

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.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by imran_khan »

Hello,

Thanks. There is no special symbol in password and permission is also OK. I know skip-networking parameter cause this issue but I don’t remove or disable it.
I want to monitor MySQL database in Nagios with skip-networking option.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by abrist »

Is there a reason you want to run with "skip-networking" enabled? If the check works locally, skip-networking should not be an issue though. How is the command defined in the remote host's nrpe.cfg?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by imran_khan »

Hello,

This server is my client server and it is in production. For security purpose my customer define this option in my.cnf file.

command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -H localhost -u xyz -p user_password
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by sreinhardt »

since you do not want to bind to a network interface, have you specified a local unix file socket for mysql, and have you attempted to specify this in the -H parameter of check_mysql?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by imran_khan »

Hello,

Yes, You are correct....
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by sreinhardt »

So what happens when you use the socket file as a host parameter? Does it allow a connection or not? I would also suggest testing this locally on the nrpe server, opposed to testing via nagios server with nrpe connection.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by imran_khan »

Hello All,

Thanks... Finally, I have resolved the mentioned issue.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by abrist »

What was the solution? (for future forum searchers)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
imran_khan
Posts: 196
Joined: Mon May 27, 2013 3:16 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by imran_khan »

Hello,

Please find the Nrpe and Nagios current setting.

NRPE Setting:-
command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -H localhost -u mysql_user -p mysql_password

Nagios Setting:-
check_command check_mysql!mysql_user!mysql_password change to

check_command check_nrpe!check_mysql!mysql_user!mysql_password

and it works fine.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to monitor MySQL in Nagios with enabled networking..

Post by abrist »

Thanks!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked