Author Topic: Cheesy varish stats page for CWP  (Read 14229 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Cheesy varish stats page for CWP
« 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>";

?>

Offline
**
Re: Cheesy varish stats page for CWP
« Reply #1 on: December 22, 2015, 08:00:17 AM »
Thats not cheesy its BOSSSS ! love it , thanks for sharing (-;

Offline
*
Re: Cheesy varish stats page for CWP
« Reply #2 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
Trying to help people :)
Chords and Lyrics

Offline
*
Re: Cheesy varish stats page for CWP
« Reply #3 on: March 08, 2018, 12:16:18 AM »
Thank You!  :D