diff options
author | awiddersheim <awiddersheim@hotmail.com> | 2013-10-14 16:49:09 (GMT) |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-01-21 10:03:14 (GMT) |
commit | fc01a54e933aadec5059bf56e79fa7aca08af6d2 (patch) | |
tree | c12780a58af658ea42ee545068a29c7d56ce9af7 | |
parent | 9db763963f3993f923619a2147e4313b09f12134 (diff) | |
download | monitoring-plugins-fc01a54e933aadec5059bf56e79fa7aca08af6d2.tar.gz |
Add performance data to check_mysql_query.c (Closes: #1202)
-rw-r--r-- | plugins/check_mysql_query.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c index 0bb83c3..7361127 100644 --- a/plugins/check_mysql_query.c +++ b/plugins/check_mysql_query.c | |||
@@ -55,7 +55,7 @@ void print_usage (void); | |||
55 | 55 | ||
56 | char *sql_query = NULL; | 56 | char *sql_query = NULL; |
57 | int verbose = 0; | 57 | int verbose = 0; |
58 | thresholds *my_thresholds = NULL; | 58 | thresholds *thlds = NULL; |
59 | 59 | ||
60 | 60 | ||
61 | int | 61 | int |
@@ -143,7 +143,7 @@ main (int argc, char **argv) | |||
143 | if (verbose >= 3) | 143 | if (verbose >= 3) |
144 | printf("mysql result: %f\n", value); | 144 | printf("mysql result: %f\n", value); |
145 | 145 | ||
146 | status = get_status(value, my_thresholds); | 146 | status = get_status(value, thlds); |
147 | 147 | ||
148 | if (status == STATE_OK) { | 148 | if (status == STATE_OK) { |
149 | printf("QUERY %s: ", _("OK")); | 149 | printf("QUERY %s: ", _("OK")); |
@@ -152,7 +152,13 @@ main (int argc, char **argv) | |||
152 | } else if (status == STATE_CRITICAL) { | 152 | } else if (status == STATE_CRITICAL) { |
153 | printf("QUERY %s: ", _("CRITICAL")); | 153 | printf("QUERY %s: ", _("CRITICAL")); |
154 | } | 154 | } |
155 | printf(_("'%s' returned %f"), sql_query, value); | 155 | printf(_("'%s' returned %f | %s"), sql_query, value, |
156 | fperfdata("result", value, "", | ||
157 | thlds->warning?TRUE:FALSE, thlds->warning?thlds->warning->end:0, | ||
158 | thlds->critical?TRUE:FALSE, thlds->critical?thlds->critical->end:0, | ||
159 | FALSE, 0, | ||
160 | FALSE, 0) | ||
161 | ); | ||
156 | printf("\n"); | 162 | printf("\n"); |
157 | 163 | ||
158 | return status; | 164 | return status; |
@@ -248,7 +254,7 @@ process_arguments (int argc, char **argv) | |||
248 | 254 | ||
249 | c = optind; | 255 | c = optind; |
250 | 256 | ||
251 | set_thresholds(&my_thresholds, warning, critical); | 257 | set_thresholds(&thlds, warning, critical); |
252 | 258 | ||
253 | return validate_arguments (); | 259 | return validate_arguments (); |
254 | } | 260 | } |