Welcome on clamsmtp-stats website

Clamsmtp-stats is a statistics and graph generator using RRD databases for the clamsmtp package.

History

The cause for making clamsmtp-stats was that we enjoyed the good looking graphs amavis-stats could produce from the amavis logs. Later we decided to replace sendmail + amavisd-new combo on our mailserver, and switched to clamsmtp. But for clamsmtp we couldn't find a solution that creates graphs like those. First attempts to recreate all from scratch were not to mention, and we looked at the sources of amavis-stats, to see how did they do it. We realized soon that a simple modification of some regular expressions makes analysing our clamsmtp logs possible. Then came the idea not to patch amavis- stats, but to clean anything amavis related, and to specialize the code for clamsmtp, and maybe later to optimize and rewrite the perl and php code. The first release of clamsmtp-stats is based on the 0.1.12-7.4 version of amavis-stats

Description

clamsmtp-stats is clamsmtp graph generator based on rrdtool. It produces graphs of clean emails and infected emails broken down by virus, from clamsmtp log entries (such as /var/log/mail.log).
The RRD files are created and updated by a perl script. Since the script uses the date/time values from the log entries it can be run (ir)regularly from cron(8) or by hand as desired. Graphs are generated by a php script.

Dependencies

We developed this version on Ubuntu Server, so i document the packages. To use this tool you basically need a working clamsmtp installation, the rrdtool or the php4-rrdtool package.

The perl script uses librrds-perl and the libio-compress-zlib-perl package.
Graphs are generated by php in combination with either the command-line rrdtool or the php4-rrdtool shared library so you need the php package.

How does it look like?

See our static demo page

Download

You can download the pre-packaged tgz or deb package in our download area
or use CVS to download the most fresh "nightly-relase"

Relases

v0.1 prealpha
This version is a patched version of amavis-stats
v0.1 alpha1
This version is cleaned from amavis-stats specific code, and the first public release
v0.2 alpha
Fully rewrited the code base.
Multi-language support
Adding a lot of config variable
Valid XHTML frontend
v0.2
First stable version

Planned features

These features are mainly ideas for the future, any ideas for features are welcome.

Full Object-Oriented code
analysing rotated gzipped logfiles - DONE see CVS
Small template engine to the frontend
Speed improvements
Making frontend more userfriendly
Support themes
Customizable graph colors
Creating some default theme
Exporting graph data to CSV
Custom graphs (custom date intervals)
Zoom graphs
Archive handling
Easy-2-Use configuration tool
Integrate a "Virus News" block

FAQ

Q. What is the best way to handle rotated (*.gz) logfiles?
How do I get all of the history in the graphs and not just the latest log?

A. clamsmtp-stats doesn't handle .tar archives at the moment. What it expects is just the name of a single uncompressed, or gzip comressed file. So when I first install it on a machine I usually do the following to get the history:

clamsmtp$ ls mail.info*
mail.info mail.info.0 mail.info.1.gz mail.info.2.gz mail.info.3.gz

clamsmtp$ /usr/sbin/clamsmtp-stats -r mail.info.3.gz
clamsmtp$ /usr/sbin/clamsmtp-stats -r mail.info.2.gz
clamsmtp$ /usr/sbin/clamsmtp-stats -r mail.info.1.gz
clamsmtp$ /usr/sbin/clamsmtp-stats -r mail.info.0
clamsmtp$ /usr/sbin/clamsmtp-stats -r mail.info

You have to manually run clamsmtp-stats on each file in the correct chronological order

Q. The rrd files seem to get generated ok but I when I try and display the web page I get the error: clamsmtp-stats::error: rrd_graph(): 127
A. I believe that the error code 127 is returned from bash when it can't find the program to execute. I guess in this case that your web user (www-data or www or web) is unable to find the "rrdtool" executable. Perhaps it is not in the standard location, or the path for that user is not set?

You could try the following to see if the tool can be found.

root# su -c env - www-data | grep PATH
root# su -c rrdtool - www-data

Q. The rrd files seem to get generated ok but I when I try and display the web page I get the error: clamsmtp-stats::error: rrd_graph(): 1
A. I believe that the error code 1 is returned from rrdtool when it can't find the directory for storing the image files. You should check that the image directory exists.

Q. The rrd files seem not to be generated and I get the error: clamsmtp-stats::error: rrd_graph(): 1
A. If you happen to use it for the first time, please try to clear the contents of the /var/lib/clamsmtp-stats/ directory and re-run the "First time run".

For submitting bugs/suggestions please visit the project page

Licence

Copyright (C) 2007, Gergely Nagy & Tamas David

clamsmtp-stats is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Authors

Gergely Nagy - nagy.gergely at gnanet dot net - sysadmin with a little programming knowledge
Tamas David - david.tamas at phpheaven dot hu - enthusiastic php programer

Thanks to

Mark Lawrence - nomad at null dot net - the original author of amavis-stats
Dale Walsh - buildsmart at daleenterprise dot com - who continues amavis-stats

Hosted by:

SourceForge.net Logo