From 013b19b7ab96847cffc6fdb9c6adb29f4da47323 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Mon, 1 Dec 2014 00:27:45 -0200 Subject: varnish3 - Add force ssl option to LB Directors, config check before reload and improve stats gui --- config/varnish3/varnishstat.php | 47 +++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'config/varnish3/varnishstat.php') diff --git a/config/varnish3/varnishstat.php b/config/varnish3/varnishstat.php index 9e4e2f3d..aa6827a8 100644 --- a/config/varnish3/varnishstat.php +++ b/config/varnish3/varnishstat.php @@ -1,8 +1,9 @@ + Copyright (C) 2014 Marcello Coutinho All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,11 +29,45 @@ */ require("guiconfig.inc"); - +require("varnish.inc"); +function open_table(){ + echo ""; + echo" "; +} +function close_table(){ + echo" "; + echo"
"; + echo "
"; +} if($_REQUEST['getactivity']) { - $varnishstatlogs = `varnishstat -1`; + //$varnishstatlogs = `varnishstat -1`; + $backends=exec("varnishstat -1",$debug); echo "

VarnishSTAT Server logs as of " . date("D M j G:i:s T Y") . "

"; - echo $varnishstatlogs; + open_table(); + print "Description"; + print "Count"; + print ""; + print ""; + foreach ($debug as $line){ + if (!preg_match("/^VBE/",$line,$lm) && + preg_match("/(\S+)\s+(\S+)\s+(\S+)\s+(.*)/",$line,$lm)) + $varnish_stats[]=$lm; + } + unset($debug); + if (is_array($varnish_stats)){ + foreach ($varnish_stats as $v){ + print " $v[4] ($v[1])"; + print "". @number_format($v[2]) .""; + print "$v[3]"; + print "  "; + } + } + else{ + print "No traffic"; + } + +close_table(); + //echo $varnishstatlogs; exit; } @@ -70,7 +105,7 @@ include("head.inc");

- +
@@ -93,7 +128,7 @@ include("head.inc");
-
+
One moment please, loading VarnishSTAT...
-- cgit v1.2.3