aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_http.c
diff options
context:
space:
mode:
authorGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-03-12 02:29:49 +0000
committerGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-03-12 02:29:49 +0000
commit70cc276eb6f828ba4d2d5efe624457992340b86a (patch)
tree6fa72efb15d94b060a0b82a5cdd2f708c6f8cb8a /plugins/check_http.c
parent91b223642a7b7f493cf87f507928d249ede27e5a (diff)
downloadmonitoring-plugins-70cc276eb6f828ba4d2d5efe624457992340b86a.tar.gz
Clean up of output from plugin
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@404 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index c947bd87..c9d4d040 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -781,21 +781,21 @@ check_http (void)
pos += (size_t) strcspn (pos, "\r\n");
pos += (size_t) strspn (pos, "\r\n");
} /* end while (pos) */
- printf ("HTTP UNKNOWN: Could not find redirect location - %s%s",
+ printf ("UNKNOWN - Could not find redirect location - %s%s",
status_line, (display_html ? "</A>" : ""));
exit (STATE_UNKNOWN);
} /* end if (onredirect == STATE_DEPENDENT) */
else if (onredirect == STATE_UNKNOWN)
- printf ("HTTP UNKNOWN");
+ printf ("UNKNOWN");
else if (onredirect == STATE_OK)
- printf ("HTTP ok");
+ printf ("OK");
else if (onredirect == STATE_WARNING)
- printf ("HTTP WARNING");
+ printf ("WARNING");
else if (onredirect == STATE_CRITICAL)
- printf ("HTTP 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 - %7.3f second response time %s%s|time=%7.3f\n",
status_line, elapsed_time, timestamp,
(display_html ? "</A>" : ""), elapsed_time);
terminate (onredirect, msg);
@@ -826,7 +826,7 @@ check_http (void)
exit (STATE_OK);
}
else {
- printf ("HTTP CRITICAL: string not found%s|time=%7.3f\n",
+ printf ("CRITICAL - string not found%s|time=%7.3f\n",
(display_html ? "</A>" : ""), elapsed_time);
exit (STATE_CRITICAL);
}
@@ -842,13 +842,13 @@ check_http (void)
}
else {
if (errcode == REG_NOMATCH) {
- printf ("HTTP CRITICAL: pattern not found%s|time=%7.3f\n",
+ printf ("CRITICAL - pattern not found%s|time=%7.3f\n",
(display_html ? "</A>" : ""), elapsed_time);
exit (STATE_CRITICAL);
}
else {
regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
- printf ("Execute Error: %s\n", errbuf);
+ printf ("CRITICAL - Execute Error: %s\n", errbuf);
exit (STATE_CRITICAL);
}
}
@@ -887,7 +887,7 @@ int connect_SSL (void)
meth = SSLv23_client_method ();
SSL_load_error_strings ();
if ((ctx = SSL_CTX_new (meth)) == NULL) {
- printf ("ERROR: Cannot create SSL context.\n");
+ printf ("CRITICAL - Cannot create SSL context.\n");
return STATE_CRITICAL;
}
@@ -911,7 +911,7 @@ int connect_SSL (void)
ERR_print_errors_fp (stderr);
}
else {
- printf ("ERROR: Cannot initiate SSL handshake.\n");
+ printf ("CRITICAL - Cannot initiate SSL handshake.\n");
}
SSL_free (ssl);
}
@@ -939,7 +939,7 @@ check_certificate (X509 ** certificate)
/* Generate tm structure to process timestamp */
if (tm->type == V_ASN1_UTCTIME) {
if (tm->length < 10) {
- printf ("ERROR: Wrong time format in certificate.\n");
+ printf ("CRITICAL - Wrong time format in certificate.\n");
return STATE_CRITICAL;
}
else {
@@ -951,7 +951,7 @@ check_certificate (X509 ** certificate)
}
else {
if (tm->length < 12) {
- printf ("ERROR: Wrong time format in certificate.\n");
+ printf ("CRITICAL - Wrong time format in certificate.\n");
return STATE_CRITICAL;
}
else {
@@ -980,20 +980,20 @@ check_certificate (X509 ** certificate)
stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min);
if (days_left > 0 && days_left <= days_till_exp) {
- printf ("Certificate expires in %d day(s) (%s).\n", days_left, timestamp);
+ printf ("WARNING - Certificate expires in %d day(s) (%s).\n", days_left, timestamp);
return STATE_WARNING;
}
if (days_left < 0) {
- printf ("Certificate expired on %s.\n", timestamp);
+ printf ("CRITICAL - Certificate expired on %s.\n", timestamp);
return STATE_CRITICAL;
}
if (days_left == 0) {
- printf ("Certificate expires today (%s).\n", timestamp);
+ printf ("WARNING - Certificate expires today (%s).\n", timestamp);
return STATE_WARNING;
}
- printf ("Certificate will expire on %s.\n", timestamp);
+ printf ("OK - Certificate will expire on %s.\n", timestamp);
return STATE_OK;
}