[rrd-users] Question about importing non-realtime CSV data into RRDtool
Simon Hobson
linux at thehobsons.co.uk
Wed Jan 4 20:13:01 CET 2012
v g wrote:
>Thanks for the prompt reply. I created a new rrd with a step of 30,
>minimum # is 0, and changed the RRA average to 10000. Below is the
>graph I got. As you can see, the X axis is garbled.
>
>http://imgur.com/zRziE
You've asked for too many x axis labels and they're overlapping. You
can see at the very ends you have a couple of clear characters. Just
ask for less labels.
>I will keep playing around with it more but any more help is
>appreciated. Also any ideas on how to handle weekly, monthly and
>yearly graphs? Shall my code include a function to concatanate
>daily csv files into weekly, and then weekly -> monthly and monthly
>-> yearly and get RRD to process those? Or is there a way to get
>RRD to handle this automatically by keeping the initial RRD database
>updated with new values and then running new graph commands (which
>is something I will explore but just wanted to run by the group on
>the ideal way of doing this...)
It's exactly what RRD was designed for - just keep feeding it data as
you get it and it all happens automagically. You need to define
additional RRAs for the resolution and timescale you need. Then when
you call rrd to make a graph, change the parameters to get the scale
you want.
I've done this with something along these lines in Bash :
case timescale in
day step=300
period=86400 # 1 day
week step=1800
period=7 day
month step=7200
period=31d
year step=86400
period=365d
# Get start and end times to match consolidation periods
now=`date +%s`
end=$(( $now / $step * $step ))
rrd graph .... --end=$end --start=end-$period ....
You can do a lot more in the case statement - like generating titles
with the period in them and so on.
--
Simon Hobson
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the rrd-users
mailing list