MINOR: checks: replace state DISABLED with CONFIGURED and ENABLED
At the moment, health checks and agent checks are tied : no agent
check is emitted if no health check is enabled. Other parameters
are considered in the condition for letting checks run. It will
help us selectively enable checks (agent and regular checks) to be
know whether they're enabled/disabled and configured or not. Now
we can already emit an error when trying to enable an unconfigured
agent.
diff --git a/src/checks.c b/src/checks.c
index 3215577..49bb411 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1165,7 +1165,7 @@
* parameter of this function is the agent or check field
* of the server.
*/
- disabled = check->server->agent.state & CHK_ST_DISABLED;
+ disabled = !(check->server->agent.state & CHK_ST_ENABLED);
if (strchr(check->bi->data, '%')) {
if (disabled)
@@ -1509,7 +1509,7 @@
if (!(s->state & SRV_CHECKED) ||
s->proxy->state == PR_STSTOPPED ||
(s->state & SRV_MAINTAIN) ||
- (check->state & CHK_ST_DISABLED))
+ !(check->state & CHK_ST_ENABLED))
goto reschedule;
/* we'll initiate a new check */