Code clean-up

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@403 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
Jeremy T. Bouse 2003-03-12 02:29:48 +00:00
parent 831d03cd76
commit 91b223642a
4 changed files with 11 additions and 12 deletions

View file

@ -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);

View file

@ -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 ? "</A>" : ""), 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 ? "</A>" : ""), 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 ? "</A>" : ""), elapsed_time);
terminate (STATE_OK, msg);

View file

@ -7,7 +7,7 @@
*
* Last Modified: $Date$
*
* Command line: check_ldap -h <host> -b <base_dn> -p <port> -w <warn_time> -w <crit_time>
* Command line: check_ldap -H <host> -b <base_dn> -p <port> -w <warn_time> -w <crit_time>
*
* 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;
}
}

View file

@ -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) {