aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-03-13 21:14:26 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-03-13 21:14:26 +0000
commitd3132db7eccca512f03edae954f360a663a6e9e5 (patch)
tree7255f754a27007809184ef011b0823c0f6e32980 /plugins
parent18a68256da0a95dbb511ec28c86a4613d325ebb5 (diff)
downloadmonitoring-plugins-d3132db7eccca512f03edae954f360a663a6e9e5.tar.gz
Strip leading spaces in perf data
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@421 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_dns.c2
-rw-r--r--plugins/check_http.c14
-rw-r--r--plugins/check_tcp.c4
3 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 2503293b..2765f643 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -193,7 +193,7 @@ main (int argc, char **argv)
else
multi_address = TRUE;
- printf ("DNS ok - %-5.3f seconds response time, address%s %s|time=%-5.3f\n",
+ printf ("DNS ok - %.3f seconds response time, address%s %s|time=%.3f\n",
elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time);
}
else if (result == STATE_WARNING)
diff --git a/plugins/check_http.c b/plugins/check_http.c
index c9d4d040..4734d75c 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -795,7 +795,7 @@ check_http (void)
else if (onredirect == STATE_CRITICAL)
printf ("CRITICAL");
elapsed_time = delta_time (tv);
- asprintf (&msg, " - %s - %7.3f second response time %s%s|time=%7.3f\n",
+ asprintf (&msg, " - %s - %.3f second response time %s%s|time=%.3f\n",
status_line, elapsed_time, timestamp,
(display_html ? "</A>" : ""), elapsed_time);
terminate (onredirect, msg);
@@ -807,7 +807,7 @@ check_http (void)
/* check elapsed time */
elapsed_time = delta_time (tv);
- asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n",
+ asprintf (&msg, "HTTP problem: %s - %.3f second response time %s%s|time=%.3f\n",
status_line, elapsed_time, timestamp,
(display_html ? "</A>" : ""), elapsed_time);
if (check_critical_time == TRUE && elapsed_time > critical_time)
@@ -820,13 +820,13 @@ check_http (void)
if (strlen (string_expect)) {
if (strstr (page, string_expect)) {
- printf ("HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n",
+ printf ("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n",
status_line, elapsed_time,
timestamp, (display_html ? "</A>" : ""), elapsed_time);
exit (STATE_OK);
}
else {
- printf ("CRITICAL - string not found%s|time=%7.3f\n",
+ printf ("CRITICAL - string not found%s|time=%.3f\n",
(display_html ? "</A>" : ""), elapsed_time);
exit (STATE_CRITICAL);
}
@@ -835,14 +835,14 @@ check_http (void)
if (strlen (regexp)) {
errcode = regexec (&preg, page, REGS, pmatch, 0);
if (errcode == 0) {
- printf ("HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n",
+ printf ("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n",
status_line, elapsed_time,
timestamp, (display_html ? "</A>" : ""), elapsed_time);
exit (STATE_OK);
}
else {
if (errcode == REG_NOMATCH) {
- printf ("CRITICAL - pattern not found%s|time=%7.3f\n",
+ printf ("CRITICAL - pattern not found%s|time=%.3f\n",
(display_html ? "</A>" : ""), elapsed_time);
exit (STATE_CRITICAL);
}
@@ -863,7 +863,7 @@ check_http (void)
exit (STATE_WARNING);
}
/* We only get here if all tests have been passed */
- asprintf (&msg, "HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n",
+ asprintf (&msg, "HTTP OK %s - %.3f second response time %s%s|time=%.3f\n",
status_line, (float)elapsed_time,
timestamp, (display_html ? "</A>" : ""), elapsed_time);
terminate (STATE_OK, msg);
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index a7d8e6f2..7d115513 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -337,14 +337,14 @@ main (int argc, char **argv)
alarm (0);
printf
- ("%s %s - %7.3f second response time on port %d",
+ ("%s %s - %.3f second response time on port %d",
SERVICE,
state_text (result), elapsed_time, server_port);
if (status && strlen(status) > 0)
printf (" [%s]", status);
- printf ("|time=%7.3f\n", elapsed_time);
+ printf ("|time=%.3f\n", elapsed_time);
return result;
}