From 5ffe1ad2f94e8cb6d9aa50160ee3ee7d511f7192 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 21 Jan 2010 10:52:41 -0500 Subject: Adding definable check inter support. Fix httpclose and forwardfor options --- config/haproxy/haproxy.inc | 8 +++++++- config/haproxy/haproxy_servers_edit.php | 12 ++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc index 034e3f9d..15a5a84d 100644 --- a/config/haproxy/haproxy.inc +++ b/config/haproxy/haproxy.inc @@ -245,8 +245,12 @@ function haproxy_configure() { } else { $advanced_txt = ""; } + if($server['checkinter']) + $checkinter = "check inter {$server['checkinter']}"; + else + $checkinter = "check inter 1000"; foreach($server_ports as $pport) - fwrite ($fd, "\tserver\t\t\t" . $server['name'] . " " . $server['address'].":" . $pport . " $cookie " . " check inter 1000 weight " . $server['weight'] . "{$advanced_txt}\n"); + fwrite ($fd, "\tserver\t\t\t" . $server['name'] . " " . $server['address'].":" . $pport . " $cookie " . " $checkinter weight " . $server['weight'] . "{$advanced_txt}\n"); } } } @@ -274,6 +278,8 @@ function haproxy_configure() { // create config file fclose($fd); + exec(""); + // reload haproxy if(isset($a_global['enable'])) { if(is_process_running('haproxy')) { diff --git a/config/haproxy/haproxy_servers_edit.php b/config/haproxy/haproxy_servers_edit.php index cf53e88b..c28dc7af 100755 --- a/config/haproxy/haproxy_servers_edit.php +++ b/config/haproxy/haproxy_servers_edit.php @@ -51,6 +51,7 @@ if (isset($id) && $a_server[$id]) { $pconfig['port'] = $a_server[$id]['port']; $pconfig['backend'] = $a_server[$id]['backend']; $pconfig['weight'] = $a_server[$id]['weight']; + $pconfig['checkinter'] = $a_server[$id]['checkinter']; $pconfig['cookie'] = $a_server[$id]['cookie']; $pconfig['status'] = $a_server[$id]['status']; $pconfig['advanced'] = base64_decode($a_server[$id]['advanced']); @@ -124,7 +125,8 @@ if ($_POST) { update_if_changed("status", $server['status'], $_POST['status']); update_if_changed("address", $server['address'], $_POST['address']); update_if_changed("advanced", $server['advanced'], base64_encode($_POST['advanced'])); - + update_if_changed("checkinter", $server['checkinter'], $_POST['checkinter']); + if (isset($id) && $a_server[$id]) { $a_server[$id] = $server; } else { @@ -285,6 +287,13 @@ function clearcombo(){ + + Check inter + + size="64"> +
Defaults to 1000 if left blank. + + Weight @@ -295,7 +304,6 @@ function clearcombo(){ is recommended to start with values which can both grow and shrink, for instance between 10 and 100 to leave enough room above and below for later adjustments. - -- cgit v1.2.3