NOTE: Please note that the supplementary tools provided with Squid Graph are distribute FREE and are not under any license. We do not support these supplementary tools and will not undertake any responsibilities should it generate inaccurate results. We have ensured, to our best possible efforts, that these programs work well enough for public distribution. However, due to time constrain, these programs are not perfect and should be considered beta quality.
Time Convertor: timeconv
timeconv
is a tool used to convert time between two different
formats -- seconds since 1970 and the conventional hh:mm:ss dd/mm/yyyy format.
To convert from seconds since 1970 to the conventional hh:mm:ss dd/mm/yyyy, we can use the -l or the -g option. The -l option gives you time in local time, whereas the -g option gives you time in GMT (Greenwich Mean Time).
Specifying the -n option will convert the time from the conventional hh:mm:ss dd/mm/yyyy format to seconds since 1970.
Let's look at some examples...
$ ./timeconv -n 12:00:00 01/01/2001 +8 978321600 $ ./timeconv -n 12:00:00 01/01/01 +8 2 digit year provided. Assuming year provided is 2001. 978321600 $ ./timeconv -n 12:00:00 01/Jan/2001 +8 978321600 $ ./timeconv -l 978321600 12:00:00 01/01/2001 $ ./timeconv -g 978321600 04:00:00 01/01/2001
Some usage guidelines:
$ ./timeconv -n hh:mm:ss dd/mm/[yy]yy [offset] $ ./timeconv -g seconds-since-1970 (Outputs time is GMT) $ ./timeconv -l seconds-since-1970 (Outputs time is local time)
Apache to Squid Logfile Convertor: apacheconv
apacheconv
is a tool which converts native Apache
HTTPd access_log
file to Squid v2 look-alike logfile. However, due to the different
types of data logged, there are missing information in the logfile.
This tool is used as an example to show the extensibility of Squid Graph as a general graph charting tool for almost any type of log file.
To use, simply pipe an Apache logfile into apacheconv
's STDIN, and then redirect
the output into Squid Graph.
$ ./apacheconv < /usr/local/apache/logs/access_log | ./squid-graph \ --output-dir=/var/www/html/reports \ --tcp-only \ --no-transfer-duration ...
CGI launcher: generate.cgi
This is a CGI script which launches Squid Graph to generate a report by automatically analyzing a logfile. We seriously don't recommend using this tool, but it is provided for convinience sake.
To use, you'll have to edit the script and define the path to your logfiles, etc.
# # Set a password # PASS=nopass # # Where's your Squid logfile? # LOGFILE=/usr/local/squid/logs/access.log # # Output directory # OUTPUT_DIR=/tmp # # Other options (do NOT include --output-dir) # OPTIONS="--tcp-only --no-transfer-duration" # # Prefix -- where is Squid Graph installed? # PREFIX=/usr/local/squid-graph
Once you've configured it, simply launch your web browser and go to http://your.web.server/some/dir/generate.cgi?password
to launch the script.
You can disable the password by setting PASS to blank, i.e.
PASS=""
![]() |
(c) 2001, SecurLogic <squid-graph@securlogic.com>
http://squid-graph.securlogic.com/ |