0

I have multiple RRD databases each with incomplete data about the availability of a service as observed from different locations. They just record 100 if the service is up, or 0 if it is down.

I want to make a graph showing whether the service was available from any location, simply by checking whether I have any data in one of the RRDs for the time period in question.

I'm trying to do this with a CDEF which uses MAXNAN to find the maximum value of my averaged data sources - here's a simplified example:

rrdtool graph /tmp/graph.png -a PNG \
--start=1427213255 \
--end=1427224055 \
--upper-limit=100 \
--lower-limit=0 \
--rigid \
DEF:d0=/tmp/location1.rrd:available:AVERAGE \
DEF:d1=/tmp/location2.rrd:available:AVERAGE \
CDEF:agg=d0,d1,MAXNAN \
AREA:agg#00DD00:availability

This produces the error

ERROR: invalid rpn expression in: d0,d1,MAXNAN

Where am I going wrong?

Paul Dixon
  • 1,516
  • 3
  • 23
  • 37

1 Answers1

1

Normally, I write a StackOverflow question and discover the answer before submitting. In this case, the answer came just afterwards. MAXNAN was added in rrdtool 1.4.9 and I'm using 1.4.7

I can do something like this which suits my use-case

CDEF:agg=d0,0,ADDNAN,d1,0,ADDNAN,MAX 

Here I'm just treating NaN as 0, and taking the max result.

Paul Dixon
  • 1,516
  • 3
  • 23
  • 37