summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_dbi.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c
index e896448..9657567 100644
--- a/plugins/check_dbi.c
+++ b/plugins/check_dbi.c
@@ -111,7 +111,8 @@ int main(int argc, char **argv) {
111 111
112 unsigned int server_version; 112 unsigned int server_version;
113 113
114 struct timeval start_timeval, end_timeval; 114 struct timeval start_timeval;
115 struct timeval end_timeval;
115 double conn_time = 0.0; 116 double conn_time = 0.0;
116 double query_time = 0.0; 117 double query_time = 0.0;
117 118
@@ -202,7 +203,8 @@ int main(int argc, char **argv) {
202 } 203 }
203 204
204 if (verbose) { 205 if (verbose) {
205 const char *dbname, *host; 206 const char *dbname;
207 const char *host;
206 208
207 dbname = dbi_conn_get_option(conn, "dbname"); 209 dbname = dbi_conn_get_option(conn, "dbname");
208 host = dbi_conn_get_option(conn, "host"); 210 host = dbi_conn_get_option(conn, "host");
@@ -424,7 +426,8 @@ int process_arguments(int argc, char **argv) {
424 case 'o': { 426 case 'o': {
425 driver_option_t *new; 427 driver_option_t *new;
426 428
427 char *k, *v; 429 char *k;
430 char *v;
428 431
429 k = optarg; 432 k = optarg;
430 v = strchr(k, (int)'='); 433 v = strchr(k, (int)'=');
@@ -462,7 +465,7 @@ int process_arguments(int argc, char **argv) {
462 return validate_arguments(); 465 return validate_arguments();
463} 466}
464 467
465int validate_arguments() { 468int validate_arguments(void) {
466 if (!np_dbi_driver) 469 if (!np_dbi_driver)
467 usage("Must specify a DBI driver"); 470 usage("Must specify a DBI driver");
468 471
@@ -639,7 +642,8 @@ double get_field(dbi_conn conn, dbi_result res, unsigned short *field_type) {
639 printf("CRITICAL - result value is not a numeric: %s\n", val_str); 642 printf("CRITICAL - result value is not a numeric: %s\n", val_str);
640 *field_type = DBI_TYPE_ERROR; 643 *field_type = DBI_TYPE_ERROR;
641 return NAN; 644 return NAN;
642 } else if ((endptr != NULL) && (*endptr != '\0')) { 645 }
646 if ((endptr != NULL) && (*endptr != '\0')) {
643 if (verbose) 647 if (verbose)
644 printf("Garbage after value: %s\n", endptr); 648 printf("Garbage after value: %s\n", endptr);
645 } 649 }
@@ -716,7 +720,8 @@ double get_query_result(dbi_conn conn, dbi_result res, const char **res_val_str,
716int do_query(dbi_conn conn, const char **res_val_str, double *res_val, double *res_time) { 720int do_query(dbi_conn conn, const char **res_val_str, double *res_val, double *res_time) {
717 dbi_result res; 721 dbi_result res;
718 722
719 struct timeval timeval_start, timeval_end; 723 struct timeval timeval_start;
724 struct timeval timeval_end;
720 int status = STATE_OK; 725 int status = STATE_OK;
721 726
722 assert(np_dbi_query); 727 assert(np_dbi_query);