Cacti shows different values than rrdtool command given in graph debug mode

James Bensley <[email protected]>
Newsgroups gmane.network.cacti.user
Message-ID <CAAWx_pUfgkTQYc8UdwRDYoQ7_q59QsQ+rAUfBgyD70vR5Ev=NA@mail.gmail.com>
Hi all,

I am trying to calculate the various values Cacti does when graphing a
network device interface (average, maximum, etc). Here is the graph
debug for an existing graph in Cacti;
http://oi45.tinypic.com/hsko3n.jpg (I have blanked out the device name
and IP etc)

I wanted to calculate the details on the command line, so I took the
rrd command run by Cacti and made a small bash script out of it, just
as below:

$cat rrdtest.sh
#!/bin/bash

rrdtool graph -f '' \
--start=$1 \
--end=$2 \
/dev/null \
DEF:a="$3":traffic_in:AVERAGE \
DEF:b="$3":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdeff=b,8,* \
PRINT:cdefa:LAST:" Current\:%8.2lf %s"  \
PRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
PRINT:cdefa:MAX:"Maximum\:%8.2lf %s"  \
PRINT:cdeff:LAST:"Current\:%8.2lf %s"  \
PRINT:cdeff:AVERAGE:"Average\:%8.2lf %s"  \
PRINT:cdeff:MAX:"Maximum\:%8.2lf %s"

$./rrdtest.sh 1357746014 1360424414 /var/lib/cacti/rra/XXXXXXX.rrd

Current:    5.24 k
Average:  153.55 k
Maximum:   13.65 M
Current:    5.06 k
Average:  158.57 k
Maximum:    6.07 M


As you can see from the link to that graph debug, none of those values
match the values in the graph yet I have pulled them from the same rrd
file using the same commands Cacti showed me. I have repeated this
with various rrd files for various host types (servers, routers,
firewalls). I assume that perhaps the graph template is changing them
slightly (although I can't see anywhere in the graph template settings
that would cause the values to be different!).

I have exported the graph template to XML and attached it to this
email, but just in case this mailing list doesn't allow attachments I
have pasted it here: http://pastebin.com/embed_js.php?i=GQMYZi8A

Why are the values displayed by Cacti different? They are only
*slightly* different? They aren't *8 higher or /8 lower, so it's not a
bits to bytes conversation. They aren't a "normal" ratio like half or
double either. They are about 1% different, how can they be *just
slightly* different?

If anyone can help me with this I would be greatly appreciative,
otherwise I shall have to work on the assumption that Cacti is
producing invalid values.

Many thanks,
James.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.