From 91b223642a7b7f493cf87f507928d249ede27e5a Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Wed, 12 Mar 2003 02:29:48 +0000 Subject: [PATCH] Code clean-up git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@403 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_dig.c | 2 +- plugins/check_http.c | 6 +++--- plugins/check_ldap.c | 10 +++++----- plugins/check_udp.c | 5 ++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/plugins/check_dig.c b/plugins/check_dig.c index 59c3b7c..8eb2b9b 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -128,7 +128,7 @@ main (int argc, char **argv) asprintf (&output, " Probably a non-existent host/domain"); if (result == STATE_OK) - printf ("DNS ok - %d seconds response time (%s)\n", + printf ("DNS OK - %d seconds response time (%s)\n", (int) (end_time - start_time), output); else if (result == STATE_WARNING) printf ("DNS WARNING - %s\n", output); diff --git a/plugins/check_http.c b/plugins/check_http.c index d6f2c15..c947bd8 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -820,7 +820,7 @@ 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 - %7.3f second response time %s%s|time=%7.3f\n", status_line, elapsed_time, timestamp, (display_html ? "" : ""), elapsed_time); exit (STATE_OK); @@ -835,7 +835,7 @@ 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 - %7.3f second response time %s%s|time=%7.3f\n", status_line, elapsed_time, timestamp, (display_html ? "" : ""), elapsed_time); exit (STATE_OK); @@ -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 - %7.3f second response time %s%s|time=%7.3f\n", status_line, (float)elapsed_time, timestamp, (display_html ? "" : ""), elapsed_time); terminate (STATE_OK, msg); diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 90fe622..5b983f4 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -7,7 +7,7 @@ * * Last Modified: $Date$ * - * Command line: check_ldap -h -b -p -w -w + * Command line: check_ldap -H -b -p -w -w * * Description: * @@ -109,17 +109,17 @@ main (int argc, char *argv[]) t_diff = time1 - time0; if (crit_time!=UNDEFINED && t_diff>=crit_time) { - printf ("LDAP critical - %i seconds response time\n", t_diff); + printf ("LDAP CRITICAL - %i seconds response time\n", t_diff); return STATE_CRITICAL; } if (warn_time!=UNDEFINED && t_diff>=warn_time) { - printf ("LDAP warning - %i seconds response time\n", t_diff); + printf ("LDAP WARNING - %i seconds response time\n", t_diff); return STATE_WARNING; } /* print out the result */ - printf ("LDAP ok - %i seconds response time\n", t_diff); + printf ("LDAP OK - %i seconds response time\n", t_diff); return STATE_OK; } @@ -198,7 +198,7 @@ process_arguments (int argc, char **argv) crit_time = atoi (optarg); break; default: - usage ("check_ldap: could not parse arguments\n"); + usage ("check_ldap: could not parse unknown arguments\n"); break; } } diff --git a/plugins/check_udp.c b/plugins/check_udp.c index ac22102..da9a142 100644 --- a/plugins/check_udp.c +++ b/plugins/check_udp.c @@ -74,9 +74,8 @@ main (int argc, char **argv) alarm (socket_timeout); time (&start_time); - result = - process_udp_request (server_address, server_port, server_send, - recv_buffer, MAX_INPUT_BUFFER - 1); + result = process_udp_request (server_address, server_port, server_send, + recv_buffer, MAX_INPUT_BUFFER - 1); time (&end_time); if (result != STATE_OK) { -- 2.30.2