diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2013-05-05 19:53:04 +0200 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2013-05-05 19:53:04 +0200 |
commit | 8586a6318f6c7429df260944b95baf9e55ac2257 (patch) | |
tree | 02b4a57034a5dc4f70291804617aed20272b0369 /config/haproxy-devel/haproxy_socketinfo.inc | |
parent | a46f939b8886ad4cb4860b26016a7b5f0b1a7e8b (diff) | |
download | pfsense-packages-8586a6318f6c7429df260944b95baf9e55ac2257.tar.gz pfsense-packages-8586a6318f6c7429df260944b95baf9e55ac2257.tar.bz2 pfsense-packages-8586a6318f6c7429df260944b95baf9e55ac2257.zip |
haproxy-devel, widget, added widget-configuration settings, fixed retrieving client traffic.
Diffstat (limited to 'config/haproxy-devel/haproxy_socketinfo.inc')
-rw-r--r-- | config/haproxy-devel/haproxy_socketinfo.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/config/haproxy-devel/haproxy_socketinfo.inc b/config/haproxy-devel/haproxy_socketinfo.inc index 117e7334..5b31afeb 100644 --- a/config/haproxy-devel/haproxy_socketinfo.inc +++ b/config/haproxy-devel/haproxy_socketinfo.inc @@ -96,7 +96,7 @@ function haproxy_get_statistics(){// "show stat" return $result; } -function haproxy_get_clients(){// "show sess" +function haproxy_get_clients($show_traffic = false){// "show sess" $clients=array(); $sessions = haproxy_socket_command("show sess"); foreach($sessions as $line) { @@ -122,8 +122,20 @@ function haproxy_get_clients(){// "show sess" "calls" => $calls[1], "exp" => $exp[1]); } + if ($show_traffic) { + foreach($clients as &$client) { + $session_data = haproxy_socket_command("show sess {$client['sessid']}"); + $client['session_data'] = $session_data; + + $req = explode(" ",$session_data[13]); + $x = explode("=",$req[7]); + $client['session_datareq'] = $x[1]; + $res = explode(" ",$session_data[16]); + $x = explode("=",$res[7]); + $client['session_datares'] = $x[1]; + } + } return $clients; } ?> - |