summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_mysql.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 18c884ca..ad3d86f3 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -50,10 +50,10 @@ char *db_socket = NULL;
50char *db_pass = NULL; 50char *db_pass = NULL;
51char *db = NULL; 51char *db = NULL;
52char *ca_cert = NULL; 52char *ca_cert = NULL;
53char *ca_path = NULL; 53char *ca_dir = NULL;
54char *cert = NULL; 54char *cert = NULL;
55char *key = NULL; 55char *key = NULL;
56char *cipher = NULL; 56char *ciphers = NULL;
57bool ssl = false; 57bool ssl = false;
58unsigned int db_port = MYSQL_PORT; 58unsigned int db_port = MYSQL_PORT;
59int check_slave = 0, warn_sec = 0, crit_sec = 0; 59int check_slave = 0, warn_sec = 0, crit_sec = 0;
@@ -96,7 +96,7 @@ main (int argc, char **argv)
96 mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"client"); 96 mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"client");
97 97
98 if (ssl) 98 if (ssl)
99 mysql_ssl_set(&mysql,key,cert,ca_cert,ca_path,cipher); 99 mysql_ssl_set(&mysql,key,cert,ca_cert,ca_dir,ciphers);
100 /* establish a connection to the server and error checking */ 100 /* establish a connection to the server and error checking */
101 if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) { 101 if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) {
102 if (mysql_errno (&mysql) == CR_UNKNOWN_HOST) 102 if (mysql_errno (&mysql) == CR_UNKNOWN_HOST)
@@ -269,11 +269,11 @@ process_arguments (int argc, char **argv)
269 {"version", no_argument, 0, 'V'}, 269 {"version", no_argument, 0, 'V'},
270 {"help", no_argument, 0, 'h'}, 270 {"help", no_argument, 0, 'h'},
271 {"ssl", no_argument, 0, 'l'}, 271 {"ssl", no_argument, 0, 'l'},
272 {"ca_cert", optional_argument, 0, 'A'}, 272 {"ca-cert", optional_argument, 0, 'C'},
273 {"key", required_argument,0,'k'}, 273 {"key", required_argument,0,'k'},
274 {"cert", required_argument,0,'a'}, 274 {"cert", required_argument,0,'a'},
275 {"ca_path", required_argument, 0, 'F'}, 275 {"ca-dir", required_argument, 0, 'D'},
276 {"cipher", required_argument, 0, 'C'}, 276 {"ciphers", required_argument, 0, 'L'},
277 {0, 0, 0, 0} 277 {0, 0, 0, 0}
278 }; 278 };
279 279
@@ -281,7 +281,7 @@ process_arguments (int argc, char **argv)
281 return ERROR; 281 return ERROR;
282 282
283 while (1) { 283 while (1) {
284 c = getopt_long (argc, argv, "hlvVSP:p:u:d:H:s:c:w:A:a:k:F:C:", longopts, &option); 284 c = getopt_long (argc, argv, "hlvVSP:p:u:d:H:s:c:w:a:k:C:D:L:", longopts, &option);
285 285
286 if (c == -1 || c == EOF) 286 if (c == -1 || c == EOF)
287 break; 287 break;
@@ -304,7 +304,7 @@ process_arguments (int argc, char **argv)
304 case 'l': 304 case 'l':
305 ssl = true; 305 ssl = true;
306 break; 306 break;
307 case 'A': 307 case 'C':
308 ca_cert = optarg; 308 ca_cert = optarg;
309 break; 309 break;
310 case 'a': 310 case 'a':
@@ -313,11 +313,11 @@ process_arguments (int argc, char **argv)
313 case 'k': 313 case 'k':
314 key = optarg; 314 key = optarg;
315 break; 315 break;
316 case 'F': 316 case 'D':
317 ca_path = optarg; 317 ca_dir = optarg;
318 break; 318 break;
319 case 'C': 319 case 'L':
320 cipher = optarg; 320 ciphers = optarg;
321 break; 321 break;
322 case 'u': /* username */ 322 case 'u': /* username */
323 db_user = optarg; 323 db_user = optarg;
@@ -443,16 +443,16 @@ print_help (void)
443 printf (" %s\n", _("behind master")); 443 printf (" %s\n", _("behind master"));
444 printf (" %s\n", "-l, --ssl"); 444 printf (" %s\n", "-l, --ssl");
445 printf (" %s\n", _("Use ssl encryptation")); 445 printf (" %s\n", _("Use ssl encryptation"));
446 printf (" %s\n", "-A, --ca_cert"); 446 printf (" %s\n", "-C, --ca-cert=STRING");
447 printf (" %s\n", _("Path to CA signing the cert")); 447 printf (" %s\n", _("Path to CA signing the cert"));
448 printf (" %s\n", "-a, --cert"); 448 printf (" %s\n", "-a, --cert=STRING");
449 printf (" %s\n", _("Path to certificate to use for encriptation")); 449 printf (" %s\n", _("Path to SSL certificate"));
450 printf (" %s\n", "-k, --key"); 450 printf (" %s\n", "-k, --key=STRING");
451 printf (" %s\n", _("Path to certificate key")); 451 printf (" %s\n", _("Path to private SSL key"));
452 printf (" %s\n", "-F, --ca_path"); 452 printf (" %s\n", "-D, --ca-dir=STRING");
453 printf (" %s\n", _("Path to CA dir")); 453 printf (" %s\n", _("Path to CA directory"));
454 printf (" %s\n", "-C, --cipher"); 454 printf (" %s\n", "-L, --ciphers=STRING");
455 printf (" %s\n", _("List of valid cipher to use for encriptation")); 455 printf (" %s\n", _("List of valid SSL ciphers"));
456 456
457 457
458 printf ("\n"); 458 printf ("\n");
@@ -474,6 +474,6 @@ print_usage (void)
474{ 474{
475 printf ("%s\n", _("Usage:")); 475 printf ("%s\n", _("Usage:"));
476 printf (" %s [-d database] [-H host] [-P port] [-s socket]\n",progname); 476 printf (" %s [-d database] [-H host] [-P port] [-s socket]\n",progname);
477 printf (" [-u user] [-p password] [-S] [-l] [-A ca] [-a cert]\n"); 477 printf (" [-u user] [-p password] [-S] [-l] [-a cert] [-k key]\n");
478 printf (" [-k key] [-F ca_dir] [-C cipher]\n"); 478 printf (" [-C ca-cert] [-D ca-dir] [-L ciphers]\n");
479} 479}