Search code examples
rrdtoolrrd

RRDTool: RRD file not updating


My RRD file is not updating, what is the reason?

The graph shows the legend with: -nanv

I created the RRD file using this syntax:

rrdtool create ups.rrd --step 300 
DS:input:GAUGE:600:0:360 
DS:output:GAUGE:600:0:360 
DS:temp:GAUGE:600:0:100 
DS:load:GAUGE:600:0:100 
DS:bcharge:GAUGE:600:0:100 
DS:battv:GAUGE:600:0:100 
RRA:AVERAGE:0.5:12:24 
RRA:AVERAGE:0.5:288:31 

Then I updated the file with this syntax:

rrdtool update ups.rrd N:$inputv:$outputv:$temp:$load:$bcharge:$battv

And graphed it with this:

rrdtool graph ups-day.png 
-t "ups " 
-s -1day 
-h 120 -w 616 
-a PNG 
-cBACK#F9F9F9 
-cSHADEA#DDDDDD 
-cSHADEB#DDDDDD 
-cGRID#D0D0D0 
-cMGRID#D0D0D0 
-cARROW#0033CC 
DEF:input=ups.rrd:input:AVERAGE 
DEF:output=ups.rrd:output:AVERAGE 
DEF:temp=ups.rrd:temp:AVERAGE 
DEF:load=ups.rrd:load:AVERAGE 
DEF:bcharge=ups.rrd:bcharge:AVERAGE 
DEF:battv=ups.rrd:battv:AVERAGE 
LINE:input#336600 
AREA:input#32CD3260:"Input Voltage" 
GPRINT:input:MAX:" Max %lgv" 
GPRINT:input:AVERAGE:" Avg %lgv" 
GPRINT:input:LAST:"Current %lgv\n" 
LINE:output#4169E1:"Output Voltage" 
GPRINT:output:MAX:"Max %lgv" 
GPRINT:output:AVERAGE:" Avg %lgv" 
GPRINT:output:LAST:"Current %lgv\n" 
LINE:load#FD570E:"Load" 
GPRINT:load:MAX:"      Max %lg%%" 
GPRINT:load:AVERAGE:" Avg %lg%%" 
GPRINT:load:LAST:" Current %lg%%\n" 
LINE:temp#000ACE:"Temperature" 
GPRINT:temp:MAX:"   Max %lgc" 
GPRINT:temp:AVERAGE:"    Avg %lgc" 
GPRINT:temp:LAST:" Current %lgc" 

Solution

  • You will need at least 13 updates, each 5min apart (IE, 12 PDP (primary data points)) before you can get a single CDP (consolidated data point) written to your RRAs, enabling you to get a data point on the graph. This is because your smallest resolution RRA is a Count 12, meaning you need 12 PDP to make one CDP.

    Until you have enough data to write a CDP, you have nothing to graph, and your graph will always have unknown data.

    Alternatively, add a smaller resolution RRA (maybe Count 1) so that you do not need to collect data for so long before you have a full CDP.