port <port>
Using the "port" parameter, it becomes possible to use a different port to
- send health-checks. On some servers, it may be desirable to dedicate a port
- to a specific component able to perform complex tests which are more suitable
- to health-checks than the application. It is common to run a simple script in
- inetd for instance. This parameter is ignored if the "check" parameter is not
- set. See also the "addr" parameter.
+ send health-checks or to probe the agent-check. On some servers, it may be
+ desirable to dedicate a port to a specific component able to perform complex
+ tests which are more suitable to health-checks than the application. It is
+ common to run a simple script in inetd for instance. This parameter is
+ ignored if the "check" parameter is not set. See also the "addr" parameter.
proto <name>
Forces the multiplexer's protocol to use for the outgoing connections to this
int set_srv_agent_send(struct server *srv, const char *send);
void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk);
+void set_srv_agent_port(struct server *srv, int port);
/* Use this one only. This inline version only ensures that we don't
* call the function when the observe mode is disabled.
#define SRV_F_NON_STICK 0x0004 /* never add connections allocated to this server to a stick table */
#define SRV_F_USE_NS_FROM_PP 0x0008 /* use namespace associated with connection if present */
#define SRV_F_FORCED_ID 0x0010 /* server's ID was forced in the configuration */
+#define SRV_F_AGENTPORT 0x0040 /* this server has a agent port configured */
#define SRV_F_AGENTADDR 0x0080 /* this server has a agent addr configured */
#define SRV_F_COOKIESET 0x0100 /* this server has a cookie configured, so don't generate dynamic cookies */
#define SRV_F_FASTOPEN 0x0200 /* Use TCP Fast Open to connect to server */
}
global.maxsock++;
- srv->agent.port = atol(args[*cur_arg+1]);
+ set_srv_agent_port(srv, atol(args[*cur_arg + 1]));
out:
return err_code;
srv->flags |= SRV_F_AGENTADDR;
}
+/* set agent port and apprropriate flag */
+inline void set_srv_agent_port(struct server *srv, int port)
+{
+ srv->agent.port = port;
+ srv->flags |= SRV_F_AGENTPORT;
+}
+
/* Parse the "agent-send" server keyword */
static int srv_parse_agent_send(char **args, int *cur_arg, struct proxy *curpx, struct server *srv,
char **errmsg)
global.maxsock++;
srv->check.port = atol(args[*cur_arg+1]);
+ /* if agentport was never set, we can use port */
+ if (!(srv->flags & SRV_F_AGENTPORT))
+ srv->agent.port = srv->check.port;
out:
return err_code;