aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/haproxy.inc
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2014-02-17 23:59:39 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2014-02-17 23:59:39 +0100
commit75350c76eebfedb665180250194427bc659b61b6 (patch)
tree2732a4ddc094b40948de23d5de8b1a9ab505674a /config/haproxy-devel/haproxy.inc
parentb23398b68fabefebd8b9c4715b81772df7c6228c (diff)
downloadpfsense-packages-75350c76eebfedb665180250194427bc659b61b6.tar.gz
pfsense-packages-75350c76eebfedb665180250194427bc659b61b6.tar.bz2
pfsense-packages-75350c76eebfedb665180250194427bc659b61b6.zip
haproxy-devel, explain and reduce required fields on stats settings
Diffstat (limited to 'config/haproxy-devel/haproxy.inc')
-rw-r--r--config/haproxy-devel/haproxy.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc
index 5ae86bb9..93019ede 100644
--- a/config/haproxy-devel/haproxy.inc
+++ b/config/haproxy-devel/haproxy.inc
@@ -456,17 +456,25 @@ function write_backend($fd, $name, $pool, $frontend) {
fwrite ($fd, "\tstats\t\t\trealm " . haproxy_escapestring($pool['stats_realm']) . "\n");
else
fwrite ($fd, "\tstats\t\t\trealm .\n");
- fwrite ($fd, "\tstats\t\t\tauth " . haproxy_escapestring($pool['stats_username']).":". haproxy_escapestring($pool['stats_password'])."\n");
+
+ if ($pool['stats_username'] && $pool['stats_password'])
+ fwrite ($fd, "\tstats\t\t\tauth " . haproxy_escapestring($pool['stats_username']).":". haproxy_escapestring($pool['stats_password'])."\n");
if($pool['stats_admin']=='yes')
fwrite ($fd, "\tstats\t\t\tadmin if TRUE" . "\n");
- if($pool['stats_node_enabled']=='yes')
+ if($pool['stats_node'])
fwrite ($fd, "\tstats\t\t\tshow-node " . $pool['stats_node'] . "\n");
if($pool['stats_desc'])
- fwrite ($fd, "\tstats\t\t\tshow-desc " . $pool['stats_desc'] . "\n");
+ fwrite ($fd, "\tstats\t\t\tshow-desc " . haproxy_escapestring($pool['stats_desc']) . "\n");
if($pool['stats_refresh'])
fwrite ($fd, "\tstats\t\t\trefresh " . $pool['stats_refresh'] . "\n");
+
+ if ($pool['stats_scope']) {
+ $scope_items = explode(",", $pool['stats_scope']);
+ foreach($scope_items as $scope_item)
+ fwrite ($fd, "\tstats\t\t\tscope " . $scope_item . "\n");
+ }
}
$uri = $pool['monitor_uri'];