Control Web Panel

Developers => I can build it => Topic started by: Darkroom on December 22, 2015, 02:57:34 AM

Title: Cheesy varish stats page for CWP
Post by: Darkroom on December 22, 2015, 02:57:34 AM
Now that I tuned varnish a bit it's recommended to keep an eye on some stats. I made this little page so I could see the output of a few commands from the web panel without having to login.

<?php
if ( !isset( $include_path ) )
{
    echo "invalid access";
    exit( );
}

$vstat = shell_exec("varnishstat -1 | head -n 6");
$vhits = shell_exec("varnishtop -1 -i rxurl | head -n 10");
$vmiss = shell_exec("varnishtop -1 -i txurl | head -n 10");
$vnuke = shell_exec("varnishstat -1 | grep nuke ");
$vmem = shell_exec("ps aux | grep 'varnish' | awk '{print $6/1024 \" MB\";}'");
echo "<h3>Varnish Statistics</h3><br><br>";
echo "<h3>Varnishstat</h3><br><pre>".$vstat."</pre><br><br>";
echo "<h3>Top 10 Hits</h3><br><pre>".$vhits."</pre><br><br>";
echo "<h3>Top 10 Misses</h3><br><pre>".$vmiss."</pre><br><br>";
echo "<h3>Varnish Nukes</h3><br><pre>".$vnuke."</pre><br><br>";
echo "<h3>Varnish Memory</h3><br><pre>".$vmem."</pre><br><br>";

?>
Title: Re: Cheesy varish stats page for CWP
Post by: Glenn on December 22, 2015, 08:00:17 AM
Thats not cheesy its BOSSSS ! love it , thanks for sharing (-;
Title: Re: Cheesy varish stats page for CWP
Post by: MyBuddyBen on June 27, 2017, 02:58:52 AM
Loved this! worked great for me!
Screen shot for those who consider using this! It's just one window from the page
(https://i.imgur.com/sh0wrXq.png)
Title: Re: Cheesy varish stats page for CWP
Post by: Jason on March 08, 2018, 12:16:18 AM
Thank You!  :D