1

I created a database with the following syntax.

rrdtool create mydatabase.rrd -s 60 \
DS:users:COUNTER:600:0:U \
DS:activeusers:GAUGE:600:0:U \
RRA:AVERAGE:0.5:360:576 \
RRA:AVERAGE:0.5:8640:672 \
RRA:AVERAGE:0.5:259200:732 \
RRA:AVERAGE:0.5:3153600:732

And I have a crontab entry that runs the following.

* * * * * rrdtool update mydatabase.rrd N:$users:$active` 

$users and $active are pulled from an external source, this is just representative.

I waited about 24 hours, and the RRDtool fetch gave me a pile of NaN results. Am I missing something really basic here, or should that work as described?

InitHello
  • 13
  • 6

1 Answers1

1

Make sure that you are actually inputting valid data. Send N:$users:$active a logfile.

Also, have an RRA file with a little bit of a higher resolution. At the moment you are storing one entry every 360 minutes = 6 hours in the first RRA file. In the last RRA file you store one update every six years for 732 years.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tobi Oetiker
  • 5,167
  • 2
  • 17
  • 23
  • ... oh. I thought the resolution was a multiple of 10 _seconds_ ... so 360 = 3600 seconds = 1 hour. Boy, do I feel silly. – InitHello Jun 04 '11 at 15:04
  • Yup, that did it. I just got `1307200500: 1.3165906598e-02 5.5653303433e+03` from `rrdtool fetch mydatabase.rrd AVERAGE -s 1307200000 -e 1307200900 -r 300`, using a database with RRAs of 5:60, 6:24, 1440:30, and 43200:12. Thanks for the tip. – InitHello Jun 04 '11 at 15:21