Quickstart
First, get yourself into the bin/
directory, for example: -
$ cd /usr/local/squid-graph/bin
Next, you run Squid Graph with the default options. The bare minimum for Squid Graph
to run is the --output-dir
option. The output directory is where the generated HTML reports
and image files would be written.
$ ./squid-graph --output-dir=/var/www/html/reports < /usr/local/squid/logs/access.logNOTE: Please check your directory permissions of your output directory!
Usually you would want the output to be generated into a directory which your
web server is configured with access to. In the above example, /usr/local/squid/logs/access.log
is
your Squid logfile.
Where you store your Squid logfile differs from system to system. For default Redhat Linux installations,
it should be in /log/squid/access.log
. For those who compiled and installed Squid with the
default options, it should be in /usr/local/squid/logs/access.log
.
Removing the TCP or UDP Graphs
Most of you won't use cache ICP or log cache ICP, so there won't be any UDP messages in your logfiles.
Disabling UDP is a good idea. You can do this by specifying the --tcp-only
command line option.
$ ./squid-graph --tcp-only --output-dir=/var/www/re...
Likewise, if you only want to see UDP statistics, you can specify the --udp-only
option.
$ ./squid-graph --udp-only --output-dir=/var/www/re...
Generating Cumulative Graphs
As of version 3.0, Squid Graph comes with a new feature to generage cumulative curves instead of the
normal graphs. This can be done by specifying the --cumulative
option.
$ ./squid-graph --cumulative --tcp-only --output-dir=/var/www/re...To have a better understanding of what cumulative curves are, take a look at the output examples. Do note that enabling cumulative graphs disables the Average Transfer Duration graph automatically.
Disabling Average Transfer Duration Graphs
You can disable the Average Transfer Duration Graph by specifying the --no-transfer-duration
option.
$ ./squid-graph --no-transfer-duration --output-dir=/var/www/re...
Specifying the Start/End Time
By default, Squid Graph generates reports based on the current time. It starts analyzing from 24 hours
before the current time until the current time. Sometimes we cycle logfiles so it is necessary
to specify when you want Squid Graph to start looking at your log files. This is done by specifying the
--start
option.
$ ./squid-graph --start=991353612 --output-dir=/var/www/re...
Likewise, you can specify the end time and Squid will automatically calculate the start time for you.
This is done by specifying the --end
command line option.
$ ./squid-graph --end=991352122 --output-dir=/var/www/re...To get the last line of the Squid logfile, simply use
tail -n1 logfile.log
Note that the start value is a numerical value which represents the number of seconds since 1970,
NOT the conventional hh:mm:ss dd/mm/yyyy format. The reason why we did this is because Squid logs its
time in this format, and we can easily use head -n1 logfile.log
to view the first line of the log
file to determine the start time.
We have created supplementary tools to convert time from hh:mm:ss dd/mm/yyyy format to
number of seconds since 1970 and vice versa. See the apacheconv
utility
in the supplementary tools section for more info.
![]() |
(c) 2001, SecurLogic <squid-graph@securlogic.com>
http://squid-graph.securlogic.com/ |