I’ve given up on rrdtool for the mean time, i can input the data OK, but it seems to be averaging the results, even though i have specified MAX. Until i can work out why this is the case, the data is useless.
My fall back is SQLite, its a nice file based SQL like structure, that is stand alone. My cron job greps through yesterdays logs and add’s the results to a SQLite table.
I want to create a web graph similar to this, a few helpful notes from SQLite and PHP and Image_Graph (pear install channel) Tutorial Part1 and Part 2 plus this Getting Started Guide also helped. Here are some example graphs using Image_Graph. I refered to PHP tutorials site too.
UPDATE: (Downloaded the latest version of Image_Graph from CVS to fix a bug in the X axis labels)
My current nightly cron script is pretty rough, and doesnt take into account log rotation at the moment.
My Basic DB structure in SQLite
sqlite3 /usr/local/stats/postgrey.db
CREATE TABLE mailstats ( date date, mailin bigint, mailout bigint, postgrey bigint, spf bigint );
Then from my cron job calculates the totals (using grep -c)
sqlite3 /usr/local/stats/postgrey.db "insert into mailstats values ( '$LASTNIGHT', $MAILIN, $MAILOUT, $POSTGREY, $SPF )"