Question

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
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top