0

I'm already (successfully) recording and plotting 3 diff. temperature values (preset, room and outside).

"rrdtool create " + config.app_dir + "/" + config.rrd_name + " " + //
  "--start N --step 300 " + // data bucket 5 min long
  "DS:temp_preset:GAUGE:600:-30:40 " + // human defined
  "DS:temp_living:GAUGE:600:-30:40 " + // measured in living room
  "DS:temp_outside:GAUGE:600:-30:40 " + // online value
  "RRA:AVERAGE:0.5:1:288 " + // 5 min avg., last 24 hours
  "RRA:AVERAGE:0.5:12:168 " + // 1 hour avg., last 7 days
  "RRA:AVERAGE:0.5:48:315 " + // 4 hour avg., last 30 days
  "RRA:AVERAGE:0.5:288:365" // 1 day avg., last 365 days

Let's say I want to add another DS, but this one for recording of an on/off (1/0) value -- heater working / heater not working.

Would this be a correct DST and the xfiles factor:

  DS:heater_state:GAUGE:600:0:1 \
  RRA:LAST:0:1:288
Saran
  • 3,845
  • 3
  • 37
  • 59

1 Answers1

1

GAUGE is fine, just note that as data is consolidated you will end up with values between 0 and 1 representing the amount of time during the observation interval the heater has been on ... if you multiply the data with 100 you would get a percentage.

Do not do any of the XFF or LAST RRA bits, just your normal

  "RRA:AVERAGE:0.5:1:288 " + // 5 min avg., last 24 hours
  "RRA:AVERAGE:0.5:12:168 " + // 1 hour avg., last 7 days
  "RRA:AVERAGE:0.5:48:315 " + // 4 hour avg., last 30 days
  "RRA:AVERAGE:0.5:288:365" // 1 day avg., last 365 days

will do fine ... except for added detail you may want to add MIN and MAX variantes to the three top consolidation levels.

Tobi Oetiker
  • 5,167
  • 2
  • 17
  • 23
  • Sorry, @TobiOetiker, but I don't understand the last sentence. Are you saying I should omit the RRA line? :o I thought that the LAST would eliminate the in-between values (or the average) and I would be left with either 0 or 1 value. – Saran Oct 21 '13 at 07:56
  • updated the answer. you do not want to eliminate the 'in between' values .. note that rrdtool is not a database for storing data 1:1 as in a classical database ... it is rather a tool for storing sampled data ... – Tobi Oetiker Oct 29 '13 at 16:47