diff options
author | Ermal Luçi <eri@pfsense.org> | 2014-02-18 08:54:24 +0100 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2014-02-18 08:54:24 +0100 |
commit | eb6f51ed37d78231ebded1792f333807d9559177 (patch) | |
tree | 986c7d4447722333f9ecbf0ebfef82b84efbc7f2 /config/haproxy-devel/haproxy.inc | |
parent | 51889bc74c3735422163eac27e630a8e5ee7164b (diff) | |
parent | 75350c76eebfedb665180250194427bc659b61b6 (diff) | |
download | pfsense-packages-eb6f51ed37d78231ebded1792f333807d9559177.tar.gz pfsense-packages-eb6f51ed37d78231ebded1792f333807d9559177.tar.bz2 pfsense-packages-eb6f51ed37d78231ebded1792f333807d9559177.zip |
Merge pull request #592 from PiBa-NL/hap_stats2
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.inc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 4713a2d1..d039b55a 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -538,17 +538,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']; |