[rrd-users] rrdtool and once-daily data?
Thomas Backman
serenity at exscape.org
Sun Mar 2 19:50:08 CET 2008
Hey everybody.
I'm not new to rrdtool, but if you consider amount of experience
rather than time used, I *am* pretty new. I've used it a lot to create
frequently updated graphs (CPU usage, TCP connections, bandwidth etc)
with next to no problems, but I've ran into a snag.
I want to create a graph with my incoming mail amount as the data. I
wrote a python script to convert the data into a rrd-like format:
rrdtool update /etc/rrdtool/mail.rrd 1193004000:163:135:118:15
rrdtool update /etc/rrdtool/mail.rrd 1193090400:192:161:139:20
rrdtool update /etc/rrdtool/mail.rrd 1192831200:141:132:111:20
rrdtool update /etc/rrdtool/mail.rrd 1192917600:117:109:99:10
... etc.
The data is once daily, I have a date like 2008-01-01 and convert it
into a timestamp (2008-01-01 00:00:00 I think) in the python script.
How should I create the RRD database, and what graph command should I
use? This is where I'm new.
I tried this:
# the --start is about 2 weeks before the data starts
rrdtool create mail.rrd --start 1188667336 \
DS:total:GAUGE:182000:0:5000 \
DS:spam:GAUGE:182000:0:5000 \
DS:deleted:GAUGE:182000:0:5000 \
DS:zapped:GAUGE:182000:0:5000 \
--step 86400 \
RRA:AVERAGE:0.5:1:3650
The data imports fine, "rrdtool info" shows the last_ds correct, etc.
But I can't graph the data properly. If I graph the last week, my
graph is empty except two 100% straight lines between midday Feb 27
and midday Feb 29 (total = 380, spam = 360). Same deal if I choose a
month instead.
Here's my graph command, so far:
/usr/bin/rrdtool graph /.../mail.png -a PNG -h 250 -w 800 -s -*time in
seconds* \
-t 'mail stats' -v '# mails' \
'DEF:total=/etc/rrdtool/mail.rrd:total:AVERAGE' \
'DEF:spam=/etc/rrdtool/mail.rrd:spam:AVERAGE' \
'LINE2:total#006600:Total' \
'LINE1:spam#FF0000:Spam\j'
Any ideas what I'm doing wrong? Any advice is appreciated. I have *no*
clue how RRA's work as of now, for instance...
Thanks in advance.
/Thomas
More information about the rrd-users
mailing list