diff options
-rw-r--r-- | plugins/check_dns.c | 2 | ||||
-rw-r--r-- | plugins/check_http.c | 14 | ||||
-rw-r--r-- | plugins/check_tcp.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 2503293..2765f64 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -193,7 +193,7 @@ main (int argc, char **argv) | |||
193 | else | 193 | else |
194 | multi_address = TRUE; | 194 | multi_address = TRUE; |
195 | 195 | ||
196 | printf ("DNS ok - %-5.3f seconds response time, address%s %s|time=%-5.3f\n", | 196 | printf ("DNS ok - %.3f seconds response time, address%s %s|time=%.3f\n", |
197 | elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time); | 197 | elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time); |
198 | } | 198 | } |
199 | else if (result == STATE_WARNING) | 199 | else if (result == STATE_WARNING) |
diff --git a/plugins/check_http.c b/plugins/check_http.c index c9d4d04..4734d75 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -795,7 +795,7 @@ check_http (void) | |||
795 | else if (onredirect == STATE_CRITICAL) | 795 | else if (onredirect == STATE_CRITICAL) |
796 | printf ("CRITICAL"); | 796 | printf ("CRITICAL"); |
797 | elapsed_time = delta_time (tv); | 797 | elapsed_time = delta_time (tv); |
798 | asprintf (&msg, " - %s - %7.3f second response time %s%s|time=%7.3f\n", | 798 | asprintf (&msg, " - %s - %.3f second response time %s%s|time=%.3f\n", |
799 | status_line, elapsed_time, timestamp, | 799 | status_line, elapsed_time, timestamp, |
800 | (display_html ? "</A>" : ""), elapsed_time); | 800 | (display_html ? "</A>" : ""), elapsed_time); |
801 | terminate (onredirect, msg); | 801 | terminate (onredirect, msg); |
@@ -807,7 +807,7 @@ check_http (void) | |||
807 | 807 | ||
808 | /* check elapsed time */ | 808 | /* check elapsed time */ |
809 | elapsed_time = delta_time (tv); | 809 | elapsed_time = delta_time (tv); |
810 | asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n", | 810 | asprintf (&msg, "HTTP problem: %s - %.3f second response time %s%s|time=%.3f\n", |
811 | status_line, elapsed_time, timestamp, | 811 | status_line, elapsed_time, timestamp, |
812 | (display_html ? "</A>" : ""), elapsed_time); | 812 | (display_html ? "</A>" : ""), elapsed_time); |
813 | if (check_critical_time == TRUE && elapsed_time > critical_time) | 813 | if (check_critical_time == TRUE && elapsed_time > critical_time) |
@@ -820,13 +820,13 @@ check_http (void) | |||
820 | 820 | ||
821 | if (strlen (string_expect)) { | 821 | if (strlen (string_expect)) { |
822 | if (strstr (page, string_expect)) { | 822 | if (strstr (page, string_expect)) { |
823 | printf ("HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n", | 823 | printf ("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n", |
824 | status_line, elapsed_time, | 824 | status_line, elapsed_time, |
825 | timestamp, (display_html ? "</A>" : ""), elapsed_time); | 825 | timestamp, (display_html ? "</A>" : ""), elapsed_time); |
826 | exit (STATE_OK); | 826 | exit (STATE_OK); |
827 | } | 827 | } |
828 | else { | 828 | else { |
829 | printf ("CRITICAL - string not found%s|time=%7.3f\n", | 829 | printf ("CRITICAL - string not found%s|time=%.3f\n", |
830 | (display_html ? "</A>" : ""), elapsed_time); | 830 | (display_html ? "</A>" : ""), elapsed_time); |
831 | exit (STATE_CRITICAL); | 831 | exit (STATE_CRITICAL); |
832 | } | 832 | } |
@@ -835,14 +835,14 @@ check_http (void) | |||
835 | if (strlen (regexp)) { | 835 | if (strlen (regexp)) { |
836 | errcode = regexec (&preg, page, REGS, pmatch, 0); | 836 | errcode = regexec (&preg, page, REGS, pmatch, 0); |
837 | if (errcode == 0) { | 837 | if (errcode == 0) { |
838 | printf ("HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n", | 838 | printf ("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n", |
839 | status_line, elapsed_time, | 839 | status_line, elapsed_time, |
840 | timestamp, (display_html ? "</A>" : ""), elapsed_time); | 840 | timestamp, (display_html ? "</A>" : ""), elapsed_time); |
841 | exit (STATE_OK); | 841 | exit (STATE_OK); |
842 | } | 842 | } |
843 | else { | 843 | else { |
844 | if (errcode == REG_NOMATCH) { | 844 | if (errcode == REG_NOMATCH) { |
845 | printf ("CRITICAL - pattern not found%s|time=%7.3f\n", | 845 | printf ("CRITICAL - pattern not found%s|time=%.3f\n", |
846 | (display_html ? "</A>" : ""), elapsed_time); | 846 | (display_html ? "</A>" : ""), elapsed_time); |
847 | exit (STATE_CRITICAL); | 847 | exit (STATE_CRITICAL); |
848 | } | 848 | } |
@@ -863,7 +863,7 @@ check_http (void) | |||
863 | exit (STATE_WARNING); | 863 | exit (STATE_WARNING); |
864 | } | 864 | } |
865 | /* We only get here if all tests have been passed */ | 865 | /* We only get here if all tests have been passed */ |
866 | asprintf (&msg, "HTTP OK %s - %7.3f second response time %s%s|time=%7.3f\n", | 866 | asprintf (&msg, "HTTP OK %s - %.3f second response time %s%s|time=%.3f\n", |
867 | status_line, (float)elapsed_time, | 867 | status_line, (float)elapsed_time, |
868 | timestamp, (display_html ? "</A>" : ""), elapsed_time); | 868 | timestamp, (display_html ? "</A>" : ""), elapsed_time); |
869 | terminate (STATE_OK, msg); | 869 | terminate (STATE_OK, msg); |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index a7d8e6f..7d11551 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -337,14 +337,14 @@ main (int argc, char **argv) | |||
337 | alarm (0); | 337 | alarm (0); |
338 | 338 | ||
339 | printf | 339 | printf |
340 | ("%s %s - %7.3f second response time on port %d", | 340 | ("%s %s - %.3f second response time on port %d", |
341 | SERVICE, | 341 | SERVICE, |
342 | state_text (result), elapsed_time, server_port); | 342 | state_text (result), elapsed_time, server_port); |
343 | 343 | ||
344 | if (status && strlen(status) > 0) | 344 | if (status && strlen(status) > 0) |
345 | printf (" [%s]", status); | 345 | printf (" [%s]", status); |
346 | 346 | ||
347 | printf ("|time=%7.3f\n", elapsed_time); | 347 | printf ("|time=%.3f\n", elapsed_time); |
348 | 348 | ||
349 | return result; | 349 | return result; |
350 | } | 350 | } |