You are here: start » resources » statistics » rrdtool
You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.
Disclamer: I admit that this whole thing is a bit of a mess, but at least it works well. I'd really appreciate if someone could make this whole thing better (simpler, easier to administer, more flexible, etc). You should be familiar with qpsmtpd, perl, apache, rrdtool and unix in general to make this mess work.
For more flexibility, I decided to make one RRD database for each type of response (color on the graph). They are all based on this format, just change the name of the database.
rrdtool create queued.rrd \ DS:mes:ABSOLUTE:600:0:U \ RRA:AVERAGE:0.5:1:600 \ RRA:AVERAGE:0.5:6:700 \ RRA:AVERAGE:0.5:24:775 \ RRA:AVERAGE:0.5:288:797
I use two tools by Peter J. Holzer to generate my data. Those tools are collapse_qpsmtpd_conn and a modified version of transaction-results. collapse_qpsmtpd_conn takes qpsmtpd's output and massage it so that it has one line per connection. transaction-results counts the number of occurence of each response and produces a pie chart with it; my modified version outputs the numbers directly to stdout where they are piped into a script that I made to feed these numbers into the RRD databases. This last script is called update.pl.
Since I don't want cummulative data but rather readings on regular intervals, I use logtail.pl, part of the Logcheck Debian package, to use only the part of the log file that is new since the last time it was run.
In summary, the whole command is something like that:
logtail.pl $logFile $offFile | collapse_qpsmtpd_conn.pl | transaction-results.pl | update.pl
In fact, this command is called from within the update.pl script, so you only need to run the update.pl script every 5 minutes by setting a cron job.
Now that you have all these RRD databases containing this nice data, wouldn't it be nice to actually see it? To do so, I'm using RRDcgi included in the RRDtool package. A sample of the code I'm using is available here.
The results are displayed on the qpsmtpd stats page.
Make a logging pluging that writes directly into the rrd files.