[rrd-users] Question with 1-hour samples

Jason iknowjason at pobox.com
Tue Jan 18 22:44:13 CET 2011


Hi List,

I'm having a great time learning RRDTool, but stuck with a problem.  I
have my 5-minute average samples working, but with the 1-hour samples,
something is wrong - the Maximum array value is different for two
different RRAs when it should be the same.

This is how my RRA is created for a 1 hour sample going back 14 days,
and 60 days:

        RRA:AVERAGE:0.5:12:336
        RRA:AVERAGE:0.5:12:1440

After collecting data for a couple of hours, the Maximum value should be
the same for both 14 days and 60 days.  However, the Maximum is lower
for the 60 days and higher for the 14 days. They are both taking a
1-hour sample, the only difference is the array rows is longer for 1 (14
days) versus the other (60 days).  Shouldn't they both display the same
maximum value?  What am I missing?  With my 5-minute average, the
Maximum is correct across 1 hour, 4 hour, and 2 day rows.  I'm stuck on
how to troubleshoot this further.  Please help.  I've read the
rrdtutorial, rrd-beginners, and some of the other graphing
documentation, and still don't understand what I'm missing.  This is my
graphing perl code snippet:

RRDs::graph ("/var/www/alerts/last14days.png",
        "--title=SIP Alerts for last 14 days (1 hour sample)",
        "--vertical-label=SIP alerts",
        "--start=$last14days_time",
        "--end=$cur_time",
        "DEF:myaverage=/home/snort/rrd/alerts/alerts.rrd:alerts:AVERAGE",
        "DEF:mymax=/home/snort/rrd/alerts/alerts.rrd:alerts:MAX",
        "CDEF:alerthouravg=myaverage,3600,*",
        "GPRINT:alerthouravg:MAX:Maximum alerts per hour\\:  %6.2lf",
        "GPRINT:alerthouravg:AVERAGE:Average alerts per hour\\:  %6.2lf",
        "GPRINT:alerthouravg:LAST:Current alerts per hour\\:  %6.2lf",
        "AREA:alerthouravg#1E90FF:Average per Hour");

my $err=RRDs::error;
if ($err) { print "Problem generating the graph:  $err\n";}

# Overview Graph for last 60 days - 1 hour sample
RRDs::graph ("/var/www/alerts/last60days.png",
        "--title=SIP Alerts for last 60 days (1 hour sample)",
        "--vertical-label=SIP alerts",
        "--start=$last60days_time",
        "--end=$cur_time",
        "DEF:myaverage=/home/snort/rrd/alerts/alerts.rrd:alerts:AVERAGE",
        "DEF:mymax=/home/snort/rrd/alerts/alerts.rrd:alerts:MAX",
        "CDEF:alerthouravg=myaverage,3600,*",
        "GPRINT:alerthouravg:MAX:Maximum alerts per hour\\:  %6.2lf",
        "GPRINT:alerthouravg:AVERAGE:Average alerts per hour\\:  %6.2lf",
        "GPRINT:alerthouravg:LAST:Current alerts per hour\\:  %6.2lf",
        "AREA:alerthouravg#1E90FF:Average per Day");






More information about the rrd-users mailing list