This is in preparation for associating a agent check with a server which runs as well as the server's existing check.
Signed-off-by: Simon Horman <horms+rene...@verge.net.au> --- v5 * Rebase --- include/types/server.h | 1 + src/cfgparse.c | 1 + src/checks.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/types/server.h b/include/types/server.h index 584dadb..cb65dbc 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -121,6 +121,7 @@ struct check { int result; /* health-check result : SRV_CHK_* */ int state; /* health-check result : CHK_* */ int type; /* Check type, one of PR_O2_*_CHK */ + const char *name; /* Name of check: "Health" or "Agent" */ struct server *server; /* back-pointer to server */ }; diff --git a/src/cfgparse.c b/src/cfgparse.c index c70700d..631a36a 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4260,6 +4260,7 @@ stats_error_parsing: newsrv->health = newsrv->rise; /* up, but will fall down at first failure */ newsrv->check.status = HCHK_STATUS_INI; + newsrv->check.name = "Health"; newsrv->check.server = newsrv; cur_arg = 3; diff --git a/src/checks.c b/src/checks.c index 75ad516..6659b6b 100644 --- a/src/checks.c +++ b/src/checks.c @@ -273,7 +273,7 @@ static void set_server_check_status(struct check *check, short status, const cha /* FIXME end: calculate local version of the health/rise/fall/state */ chunk_appendf(&trash, - "Health check for %sserver %s/%s %s%s", + "%s check for %sserver %s/%s %s%s", check->name, s->state & SRV_BACKUP ? "backup " : "", s->proxy->id, s->id, (check->result & SRV_CHK_DISABLE)?"conditionally ":"", -- 1.8.3.2