From 8586a6318f6c7429df260944b95baf9e55ac2257 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sun, 5 May 2013 19:53:04 +0200 Subject: haproxy-devel, widget, added widget-configuration settings, fixed retrieving client traffic. --- config/haproxy-devel/haproxy_socketinfo.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'config/haproxy-devel/haproxy_socketinfo.inc') 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; } ?> - -- cgit v1.2.3