Discussion:
[rrd-users] Updates once a day
(too old to reply)
Simone Morandini
2015-01-30 16:38:30 UTC
Permalink
Hello list,

I'm not new to rrdtool but I think I'm missing something basic here.
Within my network I'd like to keep track of the number of free ports on
a number of switches and, for my purpose, one value per day is enough.
So I created the rrd file as follows:

rrdtool create freeports.rrd --step 86400 DS:eth:GAUGE:172800:0:U
RRA:AVERAGE:0.5:1:30 RRA:AVERAGE:0.5:7:4 RRA:AVERAGE:0.5:30:6

to have up to a six-month history.
With this setup, when I issue an "rrdtool fetch" command, shouldn't I
see one row per day? I have the update script running since a week now,
but I still see one sigle row of output.
On the other hand, with rrdgraph I actually see more than one value
displayed, but I don't understand why the CLI command returns a single row.

Thanks in advance,
Simone
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Simon Hobson
2015-01-30 17:18:59 UTC
Permalink
With this setup, when I issue an "rrdtool fetch" command, shouldn't I see one row per day? I have the update script running since a week now, but I still see one sigle row of output.
Yes, but did you specify a period and resolution ? It's possible that it's picking the "wrong" resolution and you don't have enough data to get multiple lines.
Alex van den Bogaerdt
2015-01-31 01:38:48 UTC
Permalink
Post by Simone Morandini
I'm not new to rrdtool but I think I'm missing something basic here.
Within my network I'd like to keep track of the number of free ports on a
number of switches and, for my purpose, one value per day is enough.
rrdtool create freeports.rrd --step 86400 DS:eth:GAUGE:172800:0:U
RRA:AVERAGE:0.5:1:30 RRA:AVERAGE:0.5:7:4 RRA:AVERAGE:0.5:30:6
to have up to a six-month history.
With this setup, when I issue an "rrdtool fetch" command, shouldn't I see
one row per day? I have the update script running since a week now, but I
still see one sigle row of output.
On the other hand, with rrdgraph I actually see more than one value
displayed, but I don't understand why the CLI command returns a single
row.
You could examine the output of rrdtool dump to see what's going on.
Probably the data is there, but it's best to verify.

If the data is indeed there: It could be that the 'best' RRA selected by
RRDtool is not what you want. By providing exact numbers, there's less
chance for RRDtool go guess wrong. Or, you could add ":step=86400" to your
DS and try to force it (but RRDtool will still select another RRA if it
needs to do so).

Some mistakes include using 'now' as a timestamp (either specified or as a
default), querying more data than available in a certain RRA at either start
or end.

Are you aware that RRDtool works in UTC?
You should have something like
--end 1422662400 --start end-2419200
in your fetch command; numbers being n*86400
In your case I would get the current timestamp, round down to the nearest
multiple of 86400, and leave a little margin at the start so query 28 times
86400 seconds worth of data.
j***@seznam.cz
2015-01-31 05:40:00 UTC
Permalink
displayed, but I don't understand why the CLI command returns a single 
row.
I had similar problem years ago that I couldn't get from FETCH what I needed
(and expected).

I got rows starting sooner and the last (actual one) was empty each time.
Because I had no

time to go in details, I solved it in my script executing the FETCH command.
It has worked for

years without problems.. 




But in any case, rrd is a great tool. Thank you, Tobi!




JH
Steve Shipway
2015-01-31 07:56:34 UTC
Permalink
rrdtool create freeports.rrd --step 86400 DS:eth:GAUGE:172800:0:U
RRA:AVERAGE:0.5:1:30 RRA:AVERAGE:0.5:7:4 RRA:AVERAGE:0.5:30:6

So, your step is 1 day, then you have three RRAs, daily (month long), weekly (month long) and monthly(ish)(6mo long).

When you do a FETCH, make sure to specify the first RRA, and to have the bounds correctly to include the number of lines you want to fetch. Also, if you're not located in the UK, you might find the timezone causing problems as the step boundary is measured in UCT and so will tick over at midnight GMT.

Steve

Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
***@auckland.ac.nz
Ph: +64 9 373 7599 ext 86487
Simone Morandini
2015-02-02 11:37:32 UTC
Permalink
Post by Alex van den Bogaerdt
Are you aware that RRDtool works in UTC?
You should have something like
--end 1422662400 --start end-2419200
Thanks for the answers.
The data is indeed there, with an "rrdtool dump" I was able to see all the values (also shown by rrdgraph).
In addition, fetching as Alex suggested, i.e. using exact multiples of 86400, actually gave me the output I was expecting.

Thanks!

Simone.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Loading...