[rrd-users] rrdfetch returns wrong interval
Alex van den Bogaerdt
alex at ergens.op.het.net
Thu Nov 15 13:51:37 CET 2007
On Thu, Nov 15, 2007 at 12:33:56PM +0000, Edward Quick wrote:
>
> Hi,
>
> I'm trying to fetch datapoints for every 30 mins from my rrd, but it keeps returning points from every 5 minutes. Can anyone tell me what's wrong with my command below please?
>
> rrdtool fetch CPU_Utilisation.rrd AVERAGE -r 1800 -e 1195042722 -s 1194955200
You ask
"-e 1195042722"
There is no RRA which has one or two-second resolution. The closest match
is the RRA which has 300-second resolution.
Try asking "-e 1195041600" and "-s $((n * 1800))" where n is a positive
integer such as 48.
(equivalent: -e 1195041600 -s 1194955200)
Generally speaking, try:
-r $resolution
-s $(((starttime+resolution-1)/resolution*resolution))
-e $((endtime/resolution*resolution))
and make sure resolution can be found in the RRD.
endtime should be at most $(rrdtool last CPU_Utilisation.rrd)
starttime should be within the RRA range, this means if step = 60
and pdp_per_row = 30 and rows = 8784 then you should make sure starttime
is no less than endtime-60*30*8784
Even better is to make sure graph width equals the number of rows you
fetch, thus "-s $endtime-60*30*$graphwidth"
HTH
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
More information about the rrd-users
mailing list