[rrd-users] Bug in rrdtool xport?

"Peter Valdemar Mørch (Lists)" 4ux6as402 at sneakemail.com
Fri Sep 26 09:52:08 CEST 2008

Hi all,

On Sept 9 I posted what I think is a bug here, and have gotten no
responses so far. Was there something wrong with my report?


I provided a simple test case where "rrdtool xport" cannot correctly
export data from two different rrd files that have different step
values. "rrdtool graph" works fine with the same rrd files and shows
correct data. More and newer observations on the same issue below.

Hoping for a response,



In the meantime, I've discovered that I don't even have to have a CDEF
composed of DS'es from two different rrd files for the output to be
wrong. Just using the DEF terms for ns3 and ns4 in the rrd xport line
below also produces incorrect output:
rrdtool xport --start 1220625000 --end 1220629800 \
DEF:ns3=snmp2-0.rrd:ns3:AVERAGE XPORT:ns3:ns3 \
DEF:ns4=snmp3-0.rrd:ns4:AVERAGE XPORT:ns4:ns4

ns4's value in the output varies every 5 minute row, but snmp3-0.rrd
containing ns4 has a step of 900 ( == 15 min ), so that is clearly
wrong, isn't it? Here are the first rows, with <row></row> taken out so
it doesn't wrap in the mail:


Take out the DEF and XPORT terms for ns3, and ns4 is shown with exactly
the same values, but now 15 minutes apart. Seems rrdtool xport is taking
one value pr. <row> regardless of step, which is wrong:


Also, if I leave in the DEF for ns3, but remove the XPORT, I get the
incorrect output. So:

Correct output:
rrdtool xport --start 1220625000 --end 1220629800 \
DEF:ns4=snmp3-0.rrd:ns4:AVERAGE \

Incorrect output:
rrdtool xport --start 1220625000 --end 1220629800 \
DEF:ns3=snmp2-0.rrd:ns3:AVERAGE \
DEF:ns4=snmp3-0.rrd:ns4:AVERAGE \

Also strange, is that these two give different output:

rrdtool xport --start 1220625000 --end 1220629800 \
DEF:ns3=snmp2-0.rrd:ns3:AVERAGE \
DEF:ns4=snmp3-0.rrd:ns4:AVERAGE \
XPORT:ns3:ns3 \

rrdtool xport --start 1220625000 --end 1220629800 \
DEF:ns4=snmp3-0.rrd:ns4:AVERAGE \
DEF:ns3=snmp2-0.rrd:ns3:AVERAGE \
XPORT:ns3:ns3 \

(I swapped the sequence of the DEFs)

Looks like the step is calculated from the first DEF, whatever that
happens to be, and each row uses one value, regardless of step. "rrdtool
graph" seems smarter than that.

Hope someone else can see that this is wrong too!


Peter Valdemar Mørch (Lists) 4ux6as402-at-sneakemail.com |Lists| wrote:
> I'm have two rrd files with different steps. I try to "see" three 
> values: a DEF from each of these files, and a CDEF which is an average 
> of each of them. It seems rrdtool graph does it "right", but rrdtool 
> xport does it "wrong". Do you agree?
> In my reproducing script
> http://www.morch.com/misc/rrdxport_bug/REPRODUCE.sh.txt
> there are similar lines for graph and xport. Here graph:
> rrdtool graph --start 1220625000 --end 1220629800 ok.png \
> DEF:ns3=snmp2-0.rrd:ns3:AVERAGE 'LINE1:ns3#0000ff:ns3' \
> DEF:ns4=snmp3-0.rrd:ns4:AVERAGE 'LINE1:ns4#ff0000:ns4' \
> CDEF:avg=ns3,ns4,+,2,/          'LINE2:avg#00ff00:avg'
> ( Both the required RRD files + samle output are in:
> http://www.morch.com/misc/rrdxport_bug/ )
> rrdtool graph shows these values "correctly":
> http://www.morch.com/misc/rrdxport_bug/ok.png
> But as far as I can tell, rrdtool xport does not:
> http://www.morch.com/misc/rrdxport_bug/wrong.xml
> E.g. I would expect that exactly if either of the components (either of 
> the two DEFs) are NaN, so would the average, but that seems not to be 
> the case. Here are two example rows from wrong.xml:
> <row><t>1220627400</t><v>1.3481197778e+02</v><v>3.6073928446e-313</v><v>NaN</v></row>
> <row><t>1220626800</t><v>2.0573415556e+02</v><v>NaN</v><v>1.4496235778e+03</v></row>
> Also, the value of ns4 in the xport output is wrong when not NaN. I 
> would have expected, that
> http://www.morch.com/misc/rrdxport_bug/wrong.xml
> only contain values of ns4 that are also present in
> http://www.morch.com/misc/rrdxport_bug/good.xml which agrees with the 
> values in ok.png above.
> It sure looks to me like ok.png and wrong.xml disagree on what to show. 
> And that ok.png/good.xml are "right". Do you agree?
> If this is a bug, should I file it in trac? I seem not to be able to 
> create new bugs or register, only query existing bugs... Please let me 
> know how if you want me to file a bug report.
> Peter

Peter Valdemar Mørch

More information about the rrd-users mailing list