Page 1 of 1

check_mysql_health checks failing - access denied

Posted: Thu Dec 05, 2024 9:01 am
by gregbeyer
Hello, I used the MySQL Configuration wizard to setup several healthchecks of my nagios mysql database, but the checks are failing. The database is local to the nagios server. Using Run Check Command in Service Management, I'm getting this error:

[nagios@<obfuscated fqdn> ~]$ /usr/local/nagios/libexec/check_mysql_health --hostname=<obfuscated fqdn> --port=3306 --username=root --password="<obfuscated password>" --database=nagios --mode long-running-procs --warning 10 --critical 20
CRITICAL - cannot connect to nagios. Access denied for user 'root'@'%' to database 'nagios'

I'm attempting this check as root, as you can see, and I know the root password, double checked, using get_mysql_passwords.sh. I can CLI login to the database as root, proving the creds are correct. And, of course, root would have full access to the database. So why is this check failing?

Thanks

Re: check_mysql_health checks failing - access denied

Posted: Fri Dec 06, 2024 11:32 am
by gregbeyer
So I've continued to dig at what may be failing here. I sought out the developer of the check_mysql_health plugin, went to his website. I checked my plugin version, which returned 2.1.8.2. (2012-08-08, BTW). Then I looked at his Change Log. His latest version is 2.2.2 (2016-05-13). There have been eight versions of this plugin since the one packaged with Nagios XI. Wonder if this very problem may already be solved with the 2016 release which includes this intruiguing fix: "handle permission/syntax problems for mode sql". Note that "mode" is included in the syntax, above.

Really wondering why Nagios is packaging a way old (obsolete) version of a check_mysql_health_plugin with Nagios XI? Also wondering how many other of the 180-odd plugins packaged with Nagios XI are obsolete?

Re: check_mysql_health checks failing - access denied

Posted: Fri Dec 06, 2024 3:35 pm
by bbahn
Hello @gregbeyer,

I don't think anyone has really looked at the external plugins we pull in in quite some time. I have created an issue internally to update our plugins and to figure out a solution so this doesn't happen again in the future.

Re: check_mysql_health checks failing - access denied

Posted: Mon Dec 16, 2024 4:26 pm
by gregbeyer
Wow, that's disappointing to hear. Much of Nagios XI's monitoring functionality comes from external (3rd party) plugins. Not necessarily a bad thing -- Nagios doesn't have a monopoly on what is important to monitor or how. Plus a lot of devs like to share their chops back to the community of users. I just recently worked with @snapier3 (my need - his dev brain) to develop something new that he contributed to Exchange (Check_pctgroup). But if Nagios doesn't keep up with those plugins, and in fact ships very clearly obsolete plugins, it's essentially not keeping up with its own core monitoring technology.

MySQL isn't a niche thing. In fact, Nagios XI itself depends upon it. So how the MySQL plugin, which the XI Wizard invokes could fall off the radar is mystifying.

Please keep us posted on that internal effort. Seems like plugin updates needs to be included in an upcoming release. A regular review of plugins going forward would also probably be a good idea.

Re: check_mysql_health checks failing - access denied

Posted: Tue Dec 17, 2024 10:11 am
by DoubleDoubleA
Hi Greg,

Thanks for the tip on check_mysql_health. We are in the process of reviewing all the plugins we ship.

Aaron