aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/haproxy_socketinfo.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/haproxy-devel/haproxy_socketinfo.inc')
-rw-r--r--config/haproxy-devel/haproxy_socketinfo.inc16
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;
}
?>
-