Squid has a little system statistics viewer built-in:
The cache manager (cachemgr.cgi) is a CGI utility for displaying statistics about the squid process as it runs. The cache manager is a convenient way to manage the cache and view statistics without logging into the server.
(from Squid FAQ)
The only thing is … it’s so ugly! It uses plain HTML and cannot be customized, the FAQ says. However, there is a way to do it:
cachemgr.cgi to cachemgr2.cgi so if you do something wrong, the original is not lost.vi, but if you’re not used to working with it, use something else (emacs?).style.css file that you drop into the same folder.<link rel="stylesheet" type="text/css" href="style.css" mce_href="style.css" /> and fill up with spaces to keep the same # characterscachemgr and the cachemgr2 have the same # bytescachemgr2 to display your statistics.I did something a bit different (I wanted to use the CSS of my own website), so I ‘ll show you the difference between the two versions.
In order to get to the following comparison, I did a strings cachemgr.cgi > cachemgr.txt to extract only the text parts, and I did a diff cachemgr.txt cachemgr2.txt to compare both files. You cannot do a file comparison of 2 binary files.
<em>173,174c173,174</em>
< <HTML><HEAD><TITLE>Cache Manager Interface</TITLE>
< <STYLE type="text/css"><!-- BODY{background-color:#ffffff;font-family:verdana,sans-serif} --></STYLE></HEAD>
---
> <HTML><HEAD><TITLE>Cache Manager (pforret)</TITLE>
> <link rel="stylesheet" type="text/css" href="http://www.forret.com/forret/forret.css" mce_href="http://www.forret.com/forret/forret.css" /> </HEAD>
<em>199c199</em>
< <STYLE type="text/css"><!-- BODY{background-color:#ffffff;font-family:verdana,sans-serif} TABLE{background-color:#333333;border:0pt;padding:0pt}TH,TD{background-color:#ffffff}--></STYLE>
---
> <link rel="stylesheet" type=text/css href="http://www.forret.com/forret/forret.css" mce_href="http://www.forret.com/forret/forret.css"><!-- TABLE{background-color:#333333;border:0pt;padding:0pt} TH,TD{background-color:#ffffff}--></STYLE>
If you're new here, you may want to subscribe to my RSS feed or receive updates via email. Thanks for visiting!







or you could edit the cachemgr.c file that compiles into the cgi as much as you like then compile it.