diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-09-14 02:27:45 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-09-14 02:27:45 +0000 |
commit | dde07305649e4eafcc246f770ff65544415d74ad (patch) | |
tree | 4247422b210dc51994cc1576903906bb7c6e33e8 /plugins/check_http.c | |
parent | 4907426318fc394c3d11ba71a0694a0732cf8bf0 (diff) | |
download | monitoring-plugins-dde07305649e4eafcc246f770ff65544415d74ad.tar.gz |
time data in performance string
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@97 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index ecf61288..1b4bae34 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -726,7 +726,8 @@ check_http (void) /* Exit here if server_expect was set by user and not default */ if ( server_expect_yn ) { - msg = ssprintf (msg, "HTTP OK: Status line output matched \"%s\"\n",server_expect); + msg = ssprintf (msg, "HTTP OK: Status line output matched \"%s\"\n", + server_expect); if (verbose) printf ("%s\n",msg); @@ -821,9 +822,9 @@ check_http (void) else if (onredirect == STATE_CRITICAL) printf ("HTTP CRITICAL"); time (&end_time); - msg = ssprintf (msg, ": %s - %d second response time %s%s\n", - status_line, (int) (end_time - start_time), - timestamp, (display_html ? "</A>" : "")); + msg = ssprintf (msg, ": %s - %d second response time %s%s|time=%d\n", + status_line, (int) (end_time - start_time), timestamp, + (display_html ? "</A>" : ""), (int) (end_time - start_time)); terminate (onredirect, msg); } /* end if (strstr (status_line, "30[0-4]") */ @@ -833,9 +834,9 @@ check_http (void) /* check elapsed time */ time (&end_time); - msg = ssprintf (msg, "HTTP problem: %s - %d second response time %s%s\n", - status_line, (int) (end_time - start_time), - timestamp, (display_html ? "</A>" : "")); + msg = ssprintf (msg, "HTTP problem: %s - %d second response time %s%s|time=%d\n", + status_line, (int) (end_time - start_time), timestamp, + (display_html ? "</A>" : ""), (int) (end_time - start_time)); if (check_critical_time == TRUE && (end_time - start_time) > critical_time) terminate (STATE_CRITICAL, msg); if (check_warning_time == TRUE && (end_time - start_time) > warning_time) @@ -846,14 +847,14 @@ check_http (void) if (strlen (string_expect)) { if (strstr (page, string_expect)) { - printf ("HTTP ok: %s - %d second response time %s%s\n", + printf ("HTTP ok: %s - %d second response time %s%s|time=%d\n", status_line, (int) (end_time - start_time), - timestamp, (display_html ? "</A>" : "")); + timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time)); exit (STATE_OK); } else { - printf ("HTTP CRITICAL: string not found%s\n", - (display_html ? "</A>" : "")); + printf ("HTTP CRITICAL: string not found%s|time=%d\n", + (display_html ? "</A>" : ""), (int) (end_time - start_time)); exit (STATE_CRITICAL); } } @@ -861,15 +862,15 @@ check_http (void) if (strlen (regexp)) { errcode = regexec (&preg, page, REGS, pmatch, 0); if (errcode == 0) { - printf ("HTTP ok: %s - %d second response time %s%s\n", + printf ("HTTP ok: %s - %d second response time %s%s|time=%d\n", status_line, (int) (end_time - start_time), - timestamp, (display_html ? "</A>" : "")); + timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time)); exit (STATE_OK); } else { if (errcode == REG_NOMATCH) { - printf ("HTTP CRITICAL: pattern not found%s\n", - (display_html ? "</A>" : "")); + printf ("HTTP CRITICAL: pattern not found%s|time=%d\n", + (display_html ? "</A>" : ""), (int) (end_time - start_time)); exit (STATE_CRITICAL); } else { @@ -882,9 +883,9 @@ check_http (void) #endif /* We only get here if all tests have been passed */ - msg = ssprintf (msg, "HTTP ok: %s - %d second response time %s%s\n", + msg = ssprintf (msg, "HTTP ok: %s - %d second response time %s%s|time=%d\n", status_line, (int) (end_time - start_time), - timestamp, (display_html ? "</A>" : "")); + timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time)); terminate (STATE_OK, msg); return STATE_UNKNOWN; } |