RRD Database have no Data after 3 days (everything is truncated)

154 views Asked by At

i have create a rrd databasew (under php) with this code:

  $opts = array( "--step", "60",
 "DS:wattmin:GAUGE:300:0:8000",
 "RRA:AVERAGE:0.5:1:2160",
 "RRA:AVERAGE:0.5:5:2016",
 "RRA:AVERAGE:0.5:15:2880",
 "RRA:AVERAGE:0.5:60:8760",
 "RRA:MIN:0.5:1:2160",
 "RRA:MIN:0.5:5:2016",
 "RRA:MIN:0.5:15:2880",
 "RRA:MAX:0.5:60:8760",
 "RRA:MAX:0.5:1:2160",
 "RRA:MAX:0.5:5:2016",
 "RRA:MAX:0.5:15:2880",
 "RRA:MAX:0.5:60:8760");
$ret = rrd_create(RRD_DB_WP, $opts);

The image will be created like that:

$graphs=array("-6h","-12h","-1d","-1w","-1m","-1y");
$opts = array(
"-e now",
"--vertical-label=°C",
"-h 250",
"DEF:inoctets=".RRD_DB_WP.":wattmin:AVERAGE",
"AREA:inoctets#60B5E8:Watt/min",
"GPRINT:inbits:LAST:Las\: %4.0lfW",
"GPRINT:inbits:AVERAGE:Avg\: %4.0lfW",
"GPRINT:inbits:MAX:Max\: %4.0lfW\\n",
"DEF:grad8=".RRD_DB_TEMPS.":grad8:LAST",
"LINE2:grad8#F5A9A9:Wasser   ",
"GPRINT:grad8:LAST:Las\: %2.1lf°C",
"GPRINT:grad8:AVERAGE:Avg\: %2.1lf°C",
"GPRINT:grad8:MIN:Min\: %2.1lf°C",
"GPRINT:grad8:MAX:Max\: %1.1lf°C\\n"  );

$ret = rrd_graph(RRD_OUT_PATH. "/waermepumpe".$graph.".gif", $opts);

Everything works fine, but all data after 3 days are truncated and the created graphs after that time are always empty.

Bfo

1

There are 1 answers

2
Steve Shipway On

If your graphs are showing no data past 3 days, then they may be being generated using the smaller RRA for some reason, which does not hold data back that far.

Possible reasons for this

  • You have incorrectly created your RRD file and the larger RRAs are missing. Use rrdtool info to verify the RRD file structure is as you expect.
  • You have not collected data for that long ago. Use rrdtool dump to view the content of the RRA and confirm there really is data stored.
  • You have changed your RRA sizes or added new ones ( using rrdtool tune ) and though they now exist they do not have data
  • Your graphing is using incorrect start and endpoints for the time window
  • Your graphing is forcing 60s granularity - and hence the smaller RRA - but is trying to graph a time window outside of that RRA