summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorLorenz <12514511+RincewindsHat@users.noreply.github.com>2023-05-30 21:34:11 (GMT)
committerGitHub <noreply@github.com>2023-05-30 21:34:11 (GMT)
commit5c2f72f74f7528a3e3f5bfe5b7c6538e4f5cf9b0 (patch)
tree837129824bacfca422e2a2bec8d86605883e1d4f /plugins
parentda8d0eb3addfa2a1f966f7feb47a7cbb8124eabc (diff)
parent10863265324a9a9fdf8ce771271af15b7e2f5a4a (diff)
downloadmonitoring-plugins-5c2f72f74f7528a3e3f5bfe5b7c6538e4f5cf9b0.tar.gz
Merge pull request #1883 from Rogach/pr/check-mysql-handle-error
check_mysql: handle ER_ACCESS_DENIED_NO_PASSWORD_ERROR if ignore_auth=1
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_mysql.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 6cfa70e..91e150f 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -138,7 +138,10 @@ main (int argc, char **argv)
138 mysql_ssl_set(&mysql,key,cert,ca_cert,ca_dir,ciphers); 138 mysql_ssl_set(&mysql,key,cert,ca_cert,ca_dir,ciphers);
139 /* establish a connection to the server and error checking */ 139 /* establish a connection to the server and error checking */
140 if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) { 140 if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) {
141 if (ignore_auth && mysql_errno (&mysql) == ER_ACCESS_DENIED_ERROR) 141 /* Depending on internally-selected auth plugin MySQL might return */
142 /* ER_ACCESS_DENIED_NO_PASSWORD_ERROR or ER_ACCESS_DENIED_ERROR. */
143 /* Semantically these errors are the same. */
144 if (ignore_auth && (mysql_errno (&mysql) == ER_ACCESS_DENIED_ERROR || mysql_errno (&mysql) == ER_ACCESS_DENIED_NO_PASSWORD_ERROR))
142 { 145 {
143 printf("MySQL OK - Version: %s (protocol %d)\n", 146 printf("MySQL OK - Version: %s (protocol %d)\n",
144 mysql_get_server_info(&mysql), 147 mysql_get_server_info(&mysql),