aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar awiddersheim <awiddersheim@hotmail.com> 2013-10-14 12:49:09 -0400
committerGravatar Jan Wagner <waja@cyconet.org> 2014-01-21 11:03:14 +0100
commitfc01a54e933aadec5059bf56e79fa7aca08af6d2 (patch)
treec12780a58af658ea42ee545068a29c7d56ce9af7 /plugins
parent9db763963f3993f923619a2147e4313b09f12134 (diff)
downloadmonitoring-plugins-fc01a54e933aadec5059bf56e79fa7aca08af6d2.tar.gz
Add performance data to check_mysql_query.c (Closes: #1202)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_mysql_query.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
index 0bb83c3e..73611279 100644
--- a/plugins/check_mysql_query.c
+++ b/plugins/check_mysql_query.c
@@ -55,7 +55,7 @@ void print_usage (void);
char *sql_query = NULL;
int verbose = 0;
-thresholds *my_thresholds = NULL;
+thresholds *thlds = NULL;
int
@@ -143,7 +143,7 @@ main (int argc, char **argv)
if (verbose >= 3)
printf("mysql result: %f\n", value);
- status = get_status(value, my_thresholds);
+ status = get_status(value, thlds);
if (status == STATE_OK) {
printf("QUERY %s: ", _("OK"));
@@ -152,7 +152,13 @@ main (int argc, char **argv)
} else if (status == STATE_CRITICAL) {
printf("QUERY %s: ", _("CRITICAL"));
}
- printf(_("'%s' returned %f"), sql_query, value);
+ printf(_("'%s' returned %f | %s"), sql_query, value,
+ fperfdata("result", value, "",
+ thlds->warning?TRUE:FALSE, thlds->warning?thlds->warning->end:0,
+ thlds->critical?TRUE:FALSE, thlds->critical?thlds->critical->end:0,
+ FALSE, 0,
+ FALSE, 0)
+ );
printf("\n");
return status;
@@ -248,7 +254,7 @@ process_arguments (int argc, char **argv)
c = optind;
- set_thresholds(&my_thresholds, warning, critical);
+ set_thresholds(&thlds, warning, critical);
return validate_arguments ();
}