Inconsistent plugin behavior.
Posted: Wed Apr 21, 2021 6:32 pm
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;
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;