summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4907426)
raw | patch | inline | side by side (parent: 4907426)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sat, 14 Sep 2002 02:27:45 +0000 (02:27 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sat, 14 Sep 2002 02:27:45 +0000 (02:27 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@97 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_http.c | patch | blob | history | |
plugins/check_tcp.c | patch | blob | history |
diff --git a/plugins/check_http.c b/plugins/check_http.c
index ecf61288b9c057bd0db05dc5f0edcf1da4781d30..1b4bae348deba5053673fe4a095190e2435c11a5 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
/* 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);
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]") */
/* 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)
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);
}
}
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 {
#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;
}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index bef0e752c788cfb5148faca49ddd7d8c90fd2ca1..c537729f0764da8261a3c23f4318f4a5123ae562 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
state_text (result), (int) (end_time - start_time), server_port);
if (status)
- printf (" [%s]\n", status);
- else
- printf ("\n");
+ printf (" [%s]", status);
+
+ printf ("|time=%d\n", (int) (end_time - start_time));
return result;
}