This command is restricted and can only be issued on sockets configured for
level "admin".
+disable health <backend>/<server>
+ Mark the primary health check as temporarily stopped. This will disable
+ sending of health checks, and the last health check result will be ignored.
+ The server will be in unchecked state and considered UP unless an auxiliary
+ agent check forces it down.
+
+ This command is restricted and can only be issued on sockets configured for
+ level "admin".
+
disable server <backend>/<server>
Mark the server DOWN for maintenance. In this mode, no more checks will be
performed on the server until it leaves maintenance.
This command is restricted and can only be issued on sockets configured for
level "admin".
+enable health <backend>/<server>
+ Resume a primary health check that was temporarily stopped. This will enable
+ sending of health checks again. Please see "disable health" for details.
+
+ This command is restricted and can only be issued on sockets configured for
+ level "admin".
+
enable server <backend>/<server>
If the server was previously marked as DOWN for maintenance, this marks the
server UP and checks are re-enabled.
sv->agent.state |= CHK_ST_ENABLED;
return 1;
}
- if (strcmp(args[1], "server") == 0) {
+ else if (strcmp(args[1], "health") == 0) {
+ struct server *sv;
+
+ sv = expect_server_admin(s, si, args[2]);
+ if (!sv)
+ return 1;
+
+ if (!(sv->check.state & CHK_ST_CONFIGURED)) {
+ appctx->ctx.cli.msg = "Health checks are not configured on this server, cannot enable.\n";
+ appctx->st0 = STAT_CLI_PRINT;
+ return 1;
+ }
+
+ sv->check.state |= CHK_ST_ENABLED;
+ return 1;
+ }
+ else if (strcmp(args[1], "server") == 0) {
struct server *sv;
sv = expect_server_admin(s, si, args[2]);
return 1;
}
else { /* unknown "enable" parameter */
- appctx->ctx.cli.msg = "'enable' only supports 'agent', 'frontend' and 'server'.\n";
+ appctx->ctx.cli.msg = "'enable' only supports 'agent', 'frontend', 'health', and 'server'.\n";
appctx->st0 = STAT_CLI_PRINT;
return 1;
}
sv->agent.state &= ~CHK_ST_ENABLED;
return 1;
}
+ else if (strcmp(args[1], "health") == 0) {
+ struct server *sv;
+
+ sv = expect_server_admin(s, si, args[2]);
+ if (!sv)
+ return 1;
+
+ sv->check.state &= ~CHK_ST_ENABLED;
+ return 1;
+ }
else if (strcmp(args[1], "server") == 0) {
struct server *sv;
return 1;
}
else { /* unknown "disable" parameter */
- appctx->ctx.cli.msg = "'disable' only supports 'agent', 'frontend' and 'server'.\n";
+ appctx->ctx.cli.msg = "'disable' only supports 'agent', 'frontend', 'health', and 'server'.\n";
appctx->st0 = STAT_CLI_PRINT;
return 1;
}