aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/haproxy_socketinfo.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2014-02-17 08:36:00 +0100
committerErmal Luçi <eri@pfsense.org>2014-02-17 08:36:00 +0100
commitb23398b68fabefebd8b9c4715b81772df7c6228c (patch)
treee0004e3d7a9ce073ca74f76a5ffe0d288bc6cf3c /config/haproxy-devel/haproxy_socketinfo.inc
parent01434bbdb83f14546eb39fb96760708a5a4322e3 (diff)
parent46ea54e1b550fcac78752b70f3419a0bf1eb7ec4 (diff)
downloadpfsense-packages-b23398b68fabefebd8b9c4715b81772df7c6228c.tar.gz
pfsense-packages-b23398b68fabefebd8b9c4715b81772df7c6228c.tar.bz2
pfsense-packages-b23398b68fabefebd8b9c4715b81772df7c6228c.zip
Merge pull request #589 from PiBa-NL/hap_statspage
haproxy-devel, integrated stats page with stick-table info WebGUI
Diffstat (limited to 'config/haproxy-devel/haproxy_socketinfo.inc')
-rw-r--r--config/haproxy-devel/haproxy_socketinfo.inc25
1 files changed, 23 insertions, 2 deletions
diff --git a/config/haproxy-devel/haproxy_socketinfo.inc b/config/haproxy-devel/haproxy_socketinfo.inc
index eeaba8b6..5c6e847d 100644
--- a/config/haproxy-devel/haproxy_socketinfo.inc
+++ b/config/haproxy-devel/haproxy_socketinfo.inc
@@ -57,15 +57,36 @@ function haproxy_set_server_enabled($backend, $server, $enable) {//"enable be/se
return haproxy_socket_command("$enablecommand server $backend/$server");
}
+function haproxy_get_tables(){// "show table"
+ $result = array();
+ $cmdresult = haproxy_socket_command("show table");
+ foreach($cmdresult as $line) {
+ if (trim($line) == "")
+ continue;
+ list($table,$type,$size,$used) = explode(",", $line);
+ $table = explode(":", $table);
+ $type = explode(":", $type);
+ $size = explode(":", $size);
+ $used = explode(":", $used);
+ $newtable = array();
+ $tablename = trim($table[1]);
+ $newtable['type'] = trim($type[1]);
+ $newtable['size'] = $size[1];
+ $newtable['used'] = $used[1];
+ $result[$tablename] = $newtable;
+ }
+ return $result;
+}
+
function haproxy_get_statistics(){// "show stat"
$result = array();
$frontends=array();
$backends=array();
$servers=array();
- $result = haproxy_socket_command("show stat");
+ $cmdresult = haproxy_socket_command("show stat");
- foreach($result as $line) {
+ foreach($cmdresult as $line) {
list($pxname,$svname,$qcur,$qmax,$scur,$smax,$slim,$stot,$bin,$bout,$dreq,$dresp,$ereq,$econ,$eresp,$wretr,$wredis,$status,$weight,$act,$bck,$chkfail,$chkdown,$lastchg,$downtime,$qlimit,$pid,$iid,$sid,$throttle,$lbtot,$tracked,$type,$rate,$rate_lim,$rate_max,$check_status,$check_code,$check_duration,$hrsp_1xx,$hrsp_2xx,$hrsp_3xx,$hrsp_4xx,$hrsp_5xx,$hrsp_other,$hanafail,$req_rate,$req_rate_max,$req_tot,$cli_abrt,$srv_abrt,$comp_in,$comp_out,$comp_byp,$comp_rsp) = explode(",", $line);
#Retrieve data
switch ($svname) {