diff options
Diffstat (limited to 'plugins/check_mysql_query.c')
-rw-r--r-- | plugins/check_mysql_query.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c index 71ab7768..ac2fb15d 100644 --- a/plugins/check_mysql_query.c +++ b/plugins/check_mysql_query.c | |||
@@ -136,18 +136,18 @@ main (int argc, char **argv) | |||
136 | die (STATE_CRITICAL, "QUERY %s: Fetch row error - %s\n", _("CRITICAL"), error); | 136 | die (STATE_CRITICAL, "QUERY %s: Fetch row error - %s\n", _("CRITICAL"), error); |
137 | } | 137 | } |
138 | 138 | ||
139 | /* free the result */ | ||
140 | mysql_free_result (res); | ||
141 | |||
142 | /* close the connection */ | ||
143 | mysql_close (&mysql); | ||
144 | |||
145 | if (! is_numeric(row[0])) { | 139 | if (! is_numeric(row[0])) { |
146 | die (STATE_CRITICAL, "QUERY %s: %s - '%s'\n", _("CRITICAL"), _("Is not a numeric"), row[0]); | 140 | die (STATE_CRITICAL, "QUERY %s: %s - '%s'\n", _("CRITICAL"), _("Is not a numeric"), row[0]); |
147 | } | 141 | } |
148 | 142 | ||
149 | value = strtod(row[0], NULL); | 143 | value = strtod(row[0], NULL); |
150 | 144 | ||
145 | /* free the result */ | ||
146 | mysql_free_result (res); | ||
147 | |||
148 | /* close the connection */ | ||
149 | mysql_close (&mysql); | ||
150 | |||
151 | if (verbose >= 3) | 151 | if (verbose >= 3) |
152 | printf("mysql result: %f\n", value); | 152 | printf("mysql result: %f\n", value); |
153 | 153 | ||
@@ -250,10 +250,10 @@ process_arguments (int argc, char **argv) | |||
250 | break; | 250 | break; |
251 | case 'V': /* version */ | 251 | case 'V': /* version */ |
252 | print_revision (progname, NP_VERSION); | 252 | print_revision (progname, NP_VERSION); |
253 | exit (STATE_OK); | 253 | exit (STATE_UNKNOWN); |
254 | case 'h': /* help */ | 254 | case 'h': /* help */ |
255 | print_help (); | 255 | print_help (); |
256 | exit (STATE_OK); | 256 | exit (STATE_UNKNOWN); |
257 | case 'q': | 257 | case 'q': |
258 | xasprintf(&sql_query, "%s", optarg); | 258 | xasprintf(&sql_query, "%s", optarg); |
259 | break; | 259 | break; |