[rrd-users] zeroing out nans in a big CDEF rpn, or something
rgoldber-rrdtool at bitburst.com
Wed Feb 27 05:40:25 CET 2008
I've got about 3500 rrds, each one keeping track of 1 years worth of 5
minute netflow data. Each rrd tracks one IP and is updated every 5
minutes using the output of "flow-stat" from the flow-tools collection.
I want to be able to generate reports from this data for arbitrary lists
of IPs. For example, I want to say: give me a report for IP1,IP2,IP3
including the graph of the 5 minute PDPs and the total in/total out and
the 95th percentile.
Things are working great, except when the data contains nans. I probably
need to give an exmaple of one of my rrdgraph commands:
This example would give me the "sum" graph and 95th percentile for x.y.z.0/30
rrdtool graph -t "Report for (jimmy)" -v "bit/s" -E -w 800 -h 300
reports/report-jimmy-s200802191422-e200802261422.png --start -7d \
LINE1:95pBitsOut#ffff00:"95th out:" \
GPRINT:95pBitsOut:'%.2lf%Sb\n ' \
LINE1:95pBitsIn#00ff00:"95th in:" \
What would happen in this case is I'd get a bunch blank spots in my graph
because most of the data for x.y.z.0 is nan, and I assume the addition
function for the CDEFs doesn't allow adding nans to numbers.
The problem is due to how I collect the data: the rrds only get updated
when the netflow data actually has some data for an IP, thus x.y.z.0
rarely gets updated, and will have long periods of time filled with nans.
Now, I can change the way I collect data, and ensure that in each 5 minute
time period every rrd gets updated, but I was hoping I could leave my
collection methods alone and convince rrd graph to treats nans as 0s, or
something along those lines that would achieve the same effect.
Thanks much for your time-
More information about the rrd-users