Proxy Cache Monitoring Suite
The Proxy Cache Monitoring Suite collects data about the current state of one or more Squid proxy caches and generates HTML pages containing GIF images which provide a LIVE visual representation of the gathered data.
The package consists of 3 components:
After the installation
Since mrtg is a perl program, use your favorite text editor, load the
mrtg program and jump to the line 614 in version 2.4 :
All other tools, which use mrtg, should work with this fix as well. If
you don't trust it or it screw up your tools using mrtg, just copy mrtg
to mrtg.gps4a, make the fix there and enter the appropriate value in
your gps4a configuration file
(e.g. mrtg=/localapp/mrtg/mrtg.gps4a). No further changes are
necessary.
GPS4A
To get GPS4A to work, you have to do the following steps:
gps4a gathers all data for all dns servers running on the proxy cache
machine and stores them in htmldir/keyword/data/dnsN with N =
{1 .. NumberOfDNSServers}. If you want to have MRTG to graph the data
from more than the first 5 DNS Servers, you have to add the
appropriate options to the mrtg.conf files (Have a look at the first 5
entries for DNS Servers and you will know, how to add the others ;-)
).
The easiest way to do this is to download this configuration file and adapt it to your
needs. Everything you need to know for this is described in the
file itself. Per default gps4a.pl searches for a configuration named
.grc but you can overwrite this behavior by using the
option -f config_file.
If you have problems downloading it, try it from the download page.
NOTE: gps4a first gets all data from the caches and than
invokes MRTG to generate/update the HTML pages and gifs. If MRTG runs
the first or second time, it (rateup) issues messages, that it didn't
find old log files and that it can't remove old log files. That's
ok. But at the third time you run gps4a there should be no such
messages anymore.
0,5,10,15,20,25,30,35,40,45,50,55 * * * * etc/gps4a.pl -f etc/gps4a.conf
EchoPing
"echoping" is a small program to test (approximatively) performances of a
remote host by sending it TCP "echo" (or other protocol) packets.
Download the software from ftp://ftp.internatif.org/pub/unix/echoping/
uncompress it with the command gunzip -c echoping.tar.gz | tar xvf
-, read the INSTALL file and install the software.
FYI: When
gps4a calls echoping, it uses the parameters -n -t 10 -h as well
as the information from your gps4a configuration file (Address,
Port, Password, testurl) and passes the Median time to MRTG.
MRTG
MRTG
is a standalone program written by Tobias Oetiker. To get
gps4a work, you need to install this software. For detailed information
about this read the
Getting and Installing MRTG section on the MRTG home page, please.
You need to fix the mrtg program to get it work
properly!!!
if ($$rcfg{targcount}{$rou} == 1) {
$mode='uptime';
$uptime = $$target{$$rcfg{targorig}{$rou}}{'uptime'};
$name = $$target{$$rcfg{targorig}{$rou}}{'name'};
}
and replace the lines above with the following lines:
if ($$rcfg{targcount}{$rou} == 1) {
my $targ;
$mode='uptime';
$targ = $$rcfg{targorig}{$rou};
$targ =~ s/.*(\`[^\`]+\`).*/$1/ if $targ =~ m#\`[^\`]+\`#;
$uptime = $$target{$targ}{'uptime'};
$name = $$target{$targ}{'name'};
}
This is necessary because mrtg handles mrtg.conf Target lines not
properly if you use Targets like this:
Target[dns1]: `cat data/dns1` * 60
Without the fix mrtg stores internal data with the key "`cat data/dns1`"
but tries to look up the uptime and name values with the key
"`cat data/dns1` * 60" which results in emtpy values. Tobias
considers this as a feature, I consider it as a bug ;-).