]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: checks: Add agent-addr config directive
authorMisiek <creating.www@gmail.com>
Mon, 9 Jan 2017 08:39:51 +0000 (09:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Jan 2017 10:38:02 +0000 (11:38 +0100)
This directive add possibility to set different address for agent-checks.
With this you can manage server status and weight from central place.

Can be backported to 1.7.

src/server.c

index 0decb822b63f1d4b8beb4376c02ba6ed1fc61f16..87452d3c9d5d78d91550a385f21e78c5e8af42ea 100644 (file)
@@ -1151,6 +1151,14 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
                                newsrv->agent.inter = val;
                                cur_arg += 2;
                        }
+                       else if (!strcmp(args[cur_arg], "agent-addr")) {
+                               if(str2ip(args[cur_arg + 1], &newsrv->agent.addr) == NULL) {
+                                       Alert("parsing agent-addr failed. Check if %s is correct address.\n", args[cur_arg + 1]);
+                                       goto out;
+                               }
+
+                               cur_arg += 2;
+                       }
                        else if (!strcmp(args[cur_arg], "agent-port")) {
                                global.maxsock++;
                                newsrv->agent.port = atol(args[cur_arg + 1]);