.TH CALAMARIS 1 "$Date: 2003/05/14 21:22:37 $" Handmade "Calamaris Manual" .SH NAME calamaris \- generate statistic out of log files from Proxy-Cache-Servers .SH SYNOPSIS cat log | .B calamaris [ calamaris_options ] .SH DESCRIPTION .B Calamaris is used to produce statistical output from .BR Squid , .B NetCache, .B Inktomi Traffic Server, .B Oops! proxy server, .B Compaq Tasksmart, .B Cisco Content Engines or related Proxy log files. The resulting output can be .I ascii or .IR html . It is possible to cache calculated data in a file to use them in later runs. This manual page describes the options of .B Calamaris and gives a few examples. .SH OPTIONS .SS Reports .TP .I -a all: extracts all reports available, .I -a equals .IR "-D 10 -d 20 -P 60 -r 20 -s -t 20" . .TP .I -d n domain report: switches the top level and the second level report on. The data is derived from the URL. The output is limited by n. (-1 is unlimited) .TP .I -p type peak report: Measures the peaks of the Proxy usage in requests per second, per minute and per hour. It reports peaks for TCP, UDP and ALL requests. If set to .I 'old' these values were calculated with the old slow method, if set to .I 'new' the new faster (but still slow) method is used. .TP .I -P n performance report: Shows the throughput of TCP requests for every n minutes. .TP .I -r n requester report: Switches the UDP and TCP requester reports on. The output is limited by n. (-1 is unlimited) .TP .I -R n Requested report: adds to each line of the requester report the requested URLs. The output is limited by n. (-1 is unlimited, and can result in very very long reports.) .B Warning: Using this option breaks the privacy of your users! (see PRIVACY-Section below) .TP .I -s status report: alters the default behaviour of .B Calamaris and makes the status reports more verbose. .TP .I -t n type report: switches the content type and the file extension report on. The output is limited by n. (-1 is unlimited) .TP .I -D n Distribution Histogram: shows size-based distribution of requested objects, smaller numbers result in more verbose reports. (choose 2, 10 or 100 for useful output.) Allocation report: shows how different sized objects perform on your Proxy. .SS Input Format .TP .I -f type format: sets the type of input logfiles. If set to .I 'auto' .B Calamaris tries to guess the input file format. This is the Default. .B Note: If the first line of your input file is corrupted, Calamaris will stop with an error. .I 'squid' .B Calamaris expects native logfile derived from .B Squid V1.1.beta26-V2.x or .B OOPS. .I 'squid-extended' .B Calamaris expects native logfile derived from .B Squid V1.1.alpha1-V2.x with .I log_mime_hdrs enabled or .B Squid with .B Smartfilter-Patch. or squid-style logfiles out of .B Cisco Content Engines. (This only enables parsing of these kind of logfile, the additional data will be ignored.) (Logging of MIME-Headers breaks the privacy of your users! (see PRIVACY-Section below) .I 'squid-old' .B Calamaris expects native logfile derived from .B Squid V1.1.alpha1-V1.1.beta25. .I 'nc' .B Calamaris expects Logfiles from .B NetCache up to V4.x. (Please see the README on this.) .I 'its' .B Calamaris expects Logfiles from .B Inktomi Traffic Server. .I 'elff' .B Calamaris expects Logfiles in Extended Logfile Format (i.e. from .B Compaq Tasksmart, .B Novell Internet Caching System or .B NetCache V5.x ) .I 'nse' .B Calamaris expects Logfiles in Netscape Extended-1 or Netscape Extended-2 Logfile Format (from .B Netscape/ipoint Proxy-Server ) .SS Output Format Standard output format is plain ascii with 80 chars width. .TP .I -F type[,type[,type[,...]]] Format: sets the format of the output-report. If set to .I 'mail' adds a subject header to the beginning of the report. .I 'html' all output is given in html with tables. Can be combined with .I 'mail' to send html mails. .I 'html-embed' all output is given in html with tables without HTML-Headers. Useful for Server-Side-Includes. .I 'unformatted' gives out the raw numbers seperated by spaces. Useful for re-using the output in other scripts. If you use this along with .I -U, the byte values are calculated in the given Unit, and displayed without indication along with the numbers. the indication moves up to the header of the report. .TP .I -M string Meta: adds a custom string into the
of a HTML-Report. Useful if you want to add Stylesheets or something to the Report. .B Note: .I -M works only in combination with .IR -F html. .TP .I -l string logo: add a custom string to a HTML-Report. It'll be added to a table on the top of the output. .I -l '
'
will add my logo with a link to the Report.
.B Note:
.I -l
works only in combination with
.IR -F
html.
.TP
.I -U string
Unit: You can define this to K(ilo), M(ega), G(iga) or T(era) for
the Byte-units.
.TP
.I -S n[,n[,n[,...]]]
Show: Shows only the defined reports in the specified order. Default is to
display the reports as they are defined through the report-switches above. The
following numbers are defined:
.RS
0 Summary
.RE
.RS
1 Incoming request peak per protocol
.RE
.RS
2 Incoming transfer volume per protocol
.RE
.RS
3 Incoming requests by method
.RE
.RS
4 Incoming UDP-requests by status
.RE
.RS
5 Incoming TCP-requests by status
.RE
.RS
6 Outgoing requests by status
.RE
.RS
7 Outgoing requests by destination
.RE
.RS
8 Request-destinations by 2ndlevel-domain
.RE
.RS
9 Request-destinations by toplevel-domain
.RE
.RS
10 TCP-Request-protocol
.RE
.RS
11 Requested content-type
.RE
.RS
12 Requested extensions
.RE
.RS
13 Incoming UDP-requests by host
.RE
.RS
14 Incoming TCP-requests by host
.RE
.RS
15 Distribution Histogram
.RE
.RS
16 Performance in minute steps
.B Note:
Using this doesn't make
.B Calamaris
any faster, the internal calculations will
be done as the report-switches were set (see above).
.SS Caching
.TP
.I -i file
input file: You can reuse a cache file generated with
.I -o file
to add old data to a new report. Several files can be seperated with a ':'.
.B Note:
if you use more than one cache file, make sure they are chronologicaly
ordered (oldest first).
.B Note:
if you reuse cache-files, which were not created with
.I -d -1 -r -1 -t -1 -R -1
the number of 'others' is likely wrong everywhere.
.TP
.I -o file
output file:
.B Calamaris
stores a summary of the computed information in
.I file
and you can reuse it at a later time with
.IR -i .
.B Note:
The output file can be the same as the input file: it is simply overwritten
after reading the data. It is not recommended to change the options between
different runs if you include older data as this can result in strange
measurements.
.SS Misc
.TP
.I -H name
Host name: The name for the title or subject of the output. If set to
.I 'lookup'
.B Calamaris
looks up the host name of the system its been run on.
.TP
.I -n
no lookup: Switches the IP lookup for the requesters off.
.TP
.I -O
Order: Changes the sort order in the reports to request size, default is
sorting by number of requests.
.TP
.I -I t-t
Interval: defines which time-interval should be parsed. t has to be the
format yyyymmddhhmmss
.B Note:
omitting the beginning or ending date is allowed.
.TP
.I -N
N-level: All URL-Host reports will be switched from 2nd-level to
N-level-reports. (-1 shows a full urlhost-report)
.B Note:
This option is only useful with activated domain-report.
.TP
.I -T n
Time: Adjust the Performancereport in minutes for non GMT-Timezoners.
.TP
.I -c
case: Switch to case-insensitive. This is useful for
the 'Requested extensions' report.
.TP
.I -u
user: Switches the usage of eventually available ident information for
requester reports on.
.B Warning:
This breaks the privacy of your users! (see PRIVACY-Section below)
.TP
.I -z
zero: Switches reading from standard input off. You can use this to merge
many cache files to one (see
.I -i
and
.IR -o )
or to generate a report out of cache files.
.TP
.I -b n
benchmark: A switch for the impatient as it prints a '#' for every n parsed
lines.
.TP
.I -v
verbose: print more information about what is Calamaris is doing
and believing.
.TP
.I -L
Loop: prints the internal loop to STDERR. (for Debugging)
.TP
.I -C
Copyright: Prints the copyright information of
.BR Calamaris .
.TP
.I -h
help: Prints a brief description of the command line options.
.TP
.I -V
Version: Prints out the Version-Number.
.SH EXAMPLES
.TP
This example mails the daily statistics to root:
cat /var/log/squid/access.log | nice -39
.B calamaris
-aH 'daily worf' -F mail | mail root
.TP
This one only caches a summary for later use:
cat /var/log/squid/access.log |
.B calamaris
-a -o daily.`date +"%w"` > /dev/null
.TP
You can then use the caches to have weekly statistics:
if [ $DAYOFWEEK = "0" ]; then
.B calamaris
-a -i daily.1:daily.2:daily.3:daily.4:daily.5:daily.6:daily.0 -z -F mail -H "weekly worf" | mail root ;
fi
.SH BUGS
If you have a problem with
.BR Calamaris ,
please make sure that you use the recent version of
.B Calamaris
(see VERSION below). Also check that your proxy works correctly and doesn't
produce invalid Logfiles. (see the README for buglist and pointers.)
If you're sure that you've encountered a bug in Calamaris, please report it to
Calamaris-bug@cord.de. This also applies if Calamaris itself says 'please
report this'.
.SH PRIVACY
.B Calamaris
can be (mis-)used to track what users are requesting.
So please read the following and think about it, before using
.B Calamaris
to be the
.I Big Brother.
.TP
-
If you don't trust your users than there is something more wrong
than the loss of productivity.
.TP
-
Squid has some nice acl-mechanisms. If you think that your users
don't use the net properly, don't let them use it. (You can also
open the net at specific times or to specific sites, if you want.)
.TP
-
If you still want to use Calamaris that way, let your vict^Wusers
know, that they'll be monitored. (in Germany you have to let them
know!)
.SH "SEE ALSO"
.B squid(8)
.SH AUTHOR
Cord Beermann