blob: 1b046083c6571f1decd350a62654f44d9eb3086d [file] [log] [blame]
Krzysztof Piotr Oledzki09605412009-09-23 22:09:24 +02001/*
2 * Health-checks.
3 *
4 * Copyright 2008-2009 Krzysztof Piotr Oledzki <ole@ans.pl>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13/* check status */
14enum {
15 HCHK_STATUS_UNKNOWN = 0, /* Unknown */
16 HCHK_STATUS_INI, /* Initializing */
Krzysztof Piotr Oledzki213014e2009-09-27 15:50:02 +020017 HCHK_STATUS_START, /* Check started - SPECIAL STATUS */
Krzysztof Piotr Oledzki09605412009-09-23 22:09:24 +020018
Krzysztof Piotr Oledzki213014e2009-09-27 15:50:02 +020019 /* Below we have finished checks */
Krzysztof Piotr Oledzki09605412009-09-23 22:09:24 +020020 HCHK_STATUS_CHECKED, /* DUMMY STATUS */
21 HCHK_STATUS_SOCKERR, /* Socket error */
22
23 HCHK_STATUS_L4OK, /* L4 check passed, for example tcp connect */
24 HCHK_STATUS_L4TOUT, /* L4 timeout */
25 HCHK_STATUS_L4CON, /* L4 connection problem, for example: */
26 /* "Connection refused" (tcp rst) or "No route to host" (icmp) */
27
28 HCHK_STATUS_L6OK, /* L6 check passed */
29 HCHK_STATUS_L6TOUT, /* L6 (SSL) timeout */
30 HCHK_STATUS_L6RSP, /* L6 invalid response - protocol error */
31
32 HCHK_STATUS_L7TOUT, /* L7 (HTTP/SMTP) timeout */
33 HCHK_STATUS_L7RSP, /* L7 invalid response - protocol error */
34
35 /* Below we have layer 5-7 data avaliable */
36 HCHK_STATUS_L57DATA, /* DUMMY STATUS */
37 HCHK_STATUS_L7OKD, /* L7 check passed */
38 HCHK_STATUS_L7OKCD, /* L7 check conditionally passed */
39 HCHK_STATUS_L7STS, /* L7 response error, for example HTTP 5xx */
40
41 HCHK_STATUS_SIZE
42};
Krzysztof Piotr Oledzki213014e2009-09-27 15:50:02 +020043
44struct check_status {
45 short result; /* one of SRV_CHK_* */
46 char *info; /* human readable short info */
47 char *desc; /* long description */
48};