check_mysql_health checks failing - access denied

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
gregbeyer
Posts: 147
Joined: Fri Sep 11, 2020 2:13 pm

check_mysql_health checks failing - access denied

Post 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
gregbeyer
Posts: 147
Joined: Fri Sep 11, 2020 2:13 pm

Re: check_mysql_health checks failing - access denied

Post 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?
bbahn
Posts: 259
Joined: Thu Jan 12, 2023 5:42 pm

Re: check_mysql_health checks failing - access denied

Post 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.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
gregbeyer
Posts: 147
Joined: Fri Sep 11, 2020 2:13 pm

Re: check_mysql_health checks failing - access denied

Post 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.
DoubleDoubleA
Posts: 120
Joined: Thu Feb 09, 2017 5:07 pm

Re: check_mysql_health checks failing - access denied

Post 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
Post Reply