1

Instead of creating a graph, I need to simply output a number that is the average, max or min of some date range supplied. I have had good success with the following code:

rrdtool graph a.png --start=1325484000 --end=1364472365 DEF:power=/data1/bpoll/rrd/ws3/pdu/pdu316/a.rrd:ct12:AVERAGE 'PRINT:power:AVERAGE:%2.1lf'

However, looking at the docu, it says specifying the CF (in this case AVERAGE) is deprecated. Yet I am completely lost as to the new format. At least I can't seem to wrap my head around it. If I leave out the CF, it errors. Where exactly am I going wrong here?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
au_stan
  • 4,011
  • 2
  • 19
  • 24

1 Answers1

0
PRINT:power:AVERAGE:%2.1lf

This is the 'old style' syntax, where you pass a dataset and the consolodation function to the PRINT directive.

With the new format, you use a VDEF and so do not need a function as a VDEF is single-valued. However, you need to define the VDEF beforehand.

This is the new format:

VDEF:avgpower:power,AVERAGE
PRINT:avgpower:%2.1lf

In this example, we define a new VDEF value avgpower and print that. It has the same effect as the previous old syntax code, but is in the new sytax, which allows us to also add modifiers to the PRINT statement such as :strftime to print the point in time of maxima, and so on.

Steve Shipway
  • 3,754
  • 3
  • 22
  • 39