summaryrefslogtreecommitdiff
path: root/usr.sbin/relayctl/relayctl.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2008-12-05 16:37:57 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2008-12-05 16:37:57 +0000
commit06c9bb7c95e6c25ec6f881eee3b45305acb8f2ce (patch)
tree119b5d41c71dbfd96423fbcd35fc4eaf2d22a598 /usr.sbin/relayctl/relayctl.c
parent895ba5653d9df3632e9079b039cf884b57a73d38 (diff)
change the way relayd reports check results: instead of logging an
arbitrary string in debugging mode, it will store an error code (HCE_*) for each host. the error code can be translated to a string (in log.c) for debugging but it will also be passed to relayctl via the control socket. from a user point of view, this will print a human-readable error message in the "relayctl show hosts" output if a host is down because the check failed. the relayctl(8) manpage includes detailed explanations of the error messages including mitigations for the most-common problems. ok jmc@ (manpages) ok phessler@
Diffstat (limited to 'usr.sbin/relayctl/relayctl.c')
-rw-r--r--usr.sbin/relayctl/relayctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c
index c93c0062eb0..d7b8f42d38e 100644
--- a/usr.sbin/relayctl/relayctl.c
+++ b/usr.sbin/relayctl/relayctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayctl.c,v 1.34 2008/07/19 12:10:07 reyk Exp $ */
+/* $OpenBSD: relayctl.c,v 1.35 2008/12/05 16:37:56 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -351,6 +351,8 @@ show_summary_msg(struct imsg *imsg, int type)
"", host->up_cnt, host->check_cnt);
if (host->retry_cnt)
printf(", %d retries", host->retry_cnt);
+ if (host->he && host->up == HOST_DOWN)
+ printf(", error: %s", host_error(host->he));
printf("\n");
}
break;
@@ -461,7 +463,7 @@ print_table_status(int up, int fl)
} else if (!up) {
snprintf(buf, sizeof(buf) - 1, "empty");
} else
- snprintf(buf, sizeof(buf) - 1, "active (%d hosts up)", up);
+ snprintf(buf, sizeof(buf) - 1, "active (%d hosts)", up);
return (buf);
}