summaryrefslogtreecommitdiffstats
path: root/plugins/check_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_mysql.c')
-rw-r--r--plugins/check_mysql.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 7d855544..15ec04c0 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -59,8 +59,8 @@ bool ssl = false;
59char *opt_file = NULL; 59char *opt_file = NULL;
60char *opt_group = NULL; 60char *opt_group = NULL;
61unsigned int db_port = MYSQL_PORT; 61unsigned int db_port = MYSQL_PORT;
62int check_slave = 0, warn_sec = 0, crit_sec = 0; 62bool check_slave = false;
63int ignore_auth = 0; 63bool ignore_auth = false;
64int verbose = 0; 64int verbose = 0;
65 65
66static double warning_time = 0; 66static double warning_time = 0;
@@ -113,7 +113,7 @@ main (int argc, char **argv)
113 char slaveresult[SLAVERESULTSIZE] = { 0 }; 113 char slaveresult[SLAVERESULTSIZE] = { 0 };
114 char* perf; 114 char* perf;
115 115
116 perf = strdup (""); 116 perf = strdup ("");
117 117
118 setlocale (LC_ALL, ""); 118 setlocale (LC_ALL, "");
119 bindtextdomain (PACKAGE, LOCALEDIR); 119 bindtextdomain (PACKAGE, LOCALEDIR);
@@ -193,14 +193,14 @@ main (int argc, char **argv)
193 for(i = 0; i < LENGTH_METRIC_UNIT; i++) { 193 for(i = 0; i < LENGTH_METRIC_UNIT; i++) {
194 if (strcmp(row[0], metric_unit[i]) == 0) { 194 if (strcmp(row[0], metric_unit[i]) == 0) {
195 xasprintf(&perf, "%s%s ", perf, perfdata(metric_unit[i], 195 xasprintf(&perf, "%s%s ", perf, perfdata(metric_unit[i],
196 atol(row[1]), "", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0)); 196 atol(row[1]), "", false, 0, false, 0, false, 0, false, 0));
197 continue; 197 continue;
198 } 198 }
199 } 199 }
200 for(i = 0; i < LENGTH_METRIC_COUNTER; i++) { 200 for(i = 0; i < LENGTH_METRIC_COUNTER; i++) {
201 if (strcmp(row[0], metric_counter[i]) == 0) { 201 if (strcmp(row[0], metric_counter[i]) == 0) {
202 xasprintf(&perf, "%s%s ", perf, perfdata(metric_counter[i], 202 xasprintf(&perf, "%s%s ", perf, perfdata(metric_counter[i],
203 atol(row[1]), "c", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0)); 203 atol(row[1]), "c", false, 0, false, 0, false, 0, false, 0));
204 continue; 204 continue;
205 } 205 }
206 } 206 }
@@ -322,10 +322,10 @@ main (int argc, char **argv)
322 status = get_status(value, my_threshold); 322 status = get_status(value, my_threshold);
323 323
324 xasprintf (&perf, "%s %s", perf, fperfdata ("seconds behind master", value, "s", 324 xasprintf (&perf, "%s %s", perf, fperfdata ("seconds behind master", value, "s",
325 TRUE, (double) warning_time, 325 true, (double) warning_time,
326 TRUE, (double) critical_time, 326 true, (double) critical_time,
327 FALSE, 0, 327 false, 0,
328 FALSE, 0)); 328 false, 0));
329 329
330 if (status == STATE_WARNING) { 330 if (status == STATE_WARNING) {
331 printf("SLOW_SLAVE %s: %s|%s\n", _("WARNING"), slaveresult, perf); 331 printf("SLOW_SLAVE %s: %s|%s\n", _("WARNING"), slaveresult, perf);
@@ -456,10 +456,10 @@ process_arguments (int argc, char **argv)
456 db_port = atoi (optarg); 456 db_port = atoi (optarg);
457 break; 457 break;
458 case 'S': 458 case 'S':
459 check_slave = 1; /* check-slave */ 459 check_slave = true; /* check-slave */
460 break; 460 break;
461 case 'n': 461 case 'n':
462 ignore_auth = 1; /* ignore-auth */ 462 ignore_auth = true; /* ignore-auth */
463 break; 463 break;
464 case 'w': 464 case 'w':
465 warning = optarg; 465 warning = optarg;