Page 1 of 1

Inconsistent plugin behavior.

Posted: Wed Apr 21, 2021 6:32 pm
by matson-itops
Why am I getting different behavior running the same check using the ccm console versus CLI?

Console
[]$ /usr/local/nagios/libexec/check_mysql_query -u readonly -p'xxx' -d performance_schema -q " select variable_value from global_status where Variable_name='Max_used_connections' " -c :1000
QUERY CRITICAL: Error with query - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'Max_used_connections\'' at line 1

CLI
[]$ /usr/local/nagios/libexec/check_mysql_query -u readonly -p'xxx' -d performance_schema -q " select variable_value from global_status where Variable_name='Max_used_connections' " -c :1000
QUERY OK: ' select variable_value from global_status where Variable_name='Max_used_connections' ' returned 157.000000 | result=157.000000;;1000.000000;

Re: Inconsistent plugin behavior.

Posted: Thu Apr 22, 2021 1:24 pm
by benjaminsmith
Hi @matson-itops,

That's a known issue right now, due to security hardening the Run Check Command button used from the Core Config Manager doesn't always pass the arguments correctly, especially if there are nested quotes or special characters. Since it's returning proper from the CLI the service check should be once the configuration has been applied.

If it's failing, I would recommend cutting and pasting the command from the GUI and running a check from the CLI.

Reference
Nagios XI - How To Test Check Commands From The Command-line

Hope that helps clear that up and let us know if you have any questions or comments.

Benjamin

Re: Inconsistent plugin behavior.

Posted: Thu Apr 22, 2021 5:06 pm
by matson-itops
I literally did cut and paste from GUI to cli
And also tested from CLI to GUI and also

same issue. GUI fails. CLI works.

Re: Inconsistent plugin behavior.

Posted: Fri Apr 23, 2021 9:41 am
by benjaminsmith
Hi,

Once you apply the configuration, it should be working correctly. It's a known issue with testing the check command vis the GUI.

Benjamin