Napsty / check_mysql_slavestatus

Monitoring plugin to check the Status of a MySQL/MariaDB replication slave
15 stars 15 forks source link

Unable to connect to server #13

Closed baqwas closed 1 year ago

baqwas commented 4 years ago

Hello,

Apologies in advance if this is not the right place to submit a request for help. This is not an issue but rather a plea for some further guidance beyond your documentation. Please do not hesitate to redirect me.

Unable to get ./check_mysql_slavestatus.sh working even from the command line where I receive the following error: $ ./check_mysql_slavestatus.sh -H 127.0.0.1 -u nagios -p <password> CRITICAL: Unable to connect to server

The replication rights were granted to the user nagios as confirmed below: MariaDB [(none)]> SHOW GRANTS FOR nagios; +--------------------------------------------------------------------------------------------------------------------+ | Grants for nagios@% | +--------------------------------------------------------------------------------------------------------------------+ | GRANT REPLICATION CLIENT ON *.* TOnagios@%IDENTIFIED BY PASSWORD '*BA3BD6712CF1AE71D3969D83CDA598A2D9191CBD' | +--------------------------------------------------------------------------------------------------------------------+

Indeed I can confirm command line access to the db server locally and remotely.

The NRPE.cfg entry on the remote client (db server) is as follows: command[check_mysql_slavestatus]=/usr/local/nagios/libexec/check_mysql_slavestatus -H localhost -u nagios -p <password> with the correct string for , of course.

In other words, I can confirm connection to the db server, locally or remotely, using the same credentials that I am using for the NRPE plugin. Can you please let me know how to troubleshoot this operator/user error for your script? Thanks.

Kind regards.

Napsty commented 1 year ago

Which MySQL or MariaDB version are you using? This is most likely related to updated privileges in newer MariaDB versions. See #17

baqwas commented 1 year ago

Sorry, I should've closed the issue a long time ago. The issue(s) are probably self-inflicted because I was able to get it to work and then with later updates/upgrades went back to square one. (I have several instances and several clients). Thanks for the heads up all the same.

Regards.