diff options
author | Jim P <jim@pingle.org> | 2013-05-05 11:46:26 -0700 |
---|---|---|
committer | Jim P <jim@pingle.org> | 2013-05-05 11:46:26 -0700 |
commit | 110fef129d4a4426a0b26bfc8000fa1ead6d37ae (patch) | |
tree | 1225ff66ba3725ddd9f2d395f6d9787c7eb2e1d8 /config/haproxy-devel/haproxy_socketinfo.inc | |
parent | 7a9c4f49b8fcb9b0d9eedd17046fc3b030c9bb96 (diff) | |
parent | 8586a6318f6c7429df260944b95baf9e55ac2257 (diff) | |
download | pfsense-packages-110fef129d4a4426a0b26bfc8000fa1ead6d37ae.tar.gz pfsense-packages-110fef129d4a4426a0b26bfc8000fa1ead6d37ae.tar.bz2 pfsense-packages-110fef129d4a4426a0b26bfc8000fa1ead6d37ae.zip |
Merge pull request #444 from PiBa-NL/haproxy-devel-2.1
haproxy-devel, widget, added widget-configuration settings, fixed showing 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; } ?> - |