[rrd-users] Strange rrdtool behaviour (IMHO)

Bartosz Oudekerk bartosz at etv.cx
Tue Jan 4 21:49:56 MET 2005


Hi,

I just started 'playing' with rrdtool a few days ago, but there's some
stuff I can't seem to figure out.

My input data is generated by the script below, which runs every other
minute.
I cut the lines to make it more readable, although I'm not sure it
helped much.
The output looks like:
/usr/local/bin/rrdtool update /var/rrd/pingstats.rrd N:9.835:10.830:11.584:0

#v+

#!/bin/bash

OUTPUT="$(/bin/ping -c30 -i2 -n -q $IPADRESS)"
$( /usr/bin/echo ${OUTPUT} | /usr/bin/sed -e \
's#.*,\ \(.*\)%.*=\ \(.*\)/\(.*\)/\(.*\)/.*\
#\/usr\/local\/bin\/rrdtool\ update\ /var/rrd/pingstats.rrd N:\2:\3:\4:\1#')
/usr/bin/echo ${OUTPUT} | /usr/bin/sed -e \
's#.*,\ \(.*\)%.*=\ \(.*\)/\(.*\)/\(.*\)/.*\
#\/usr\/local\/bin\/rrdtool\ update\ /var/rrd/pingstats.rrd N:\2:\3:\4:\1#'

#v-

The first version of the rrd was created as such:
rrdtool create pingstats.rrd --step 120 \
DS:rtt-min:GAUGE:150:U:U \
DS:rtt-avg:GAUGE:150:U:U \
DS:rtt-max:GAUGE:150:U:U \
DS:pl:GAUGE:150:U:U \
RRA:AVERAGE:0.5:1:262800 \
RRA:MAX:0.5:1:262800 \
RRA:MIN:0.5:1:262800

And the idea was to then generate graphs like such:
/usr/local/bin/rrdtool graph /home/tyranas/pics/rrd/ping-1.png \
--start $(date -d "1 hour ago" +%s) --vertical-label ms \
--imgformat PNG DEF:rtt=/var/rrd/pingstats.rrd:rtt-avg:AVERAGE \
DEF:rttma=/var/rrd/pingstats.rrd:rtt-max:MAX \
DEF:rttmi=/var/rrd/pingstats.rrd:rtt-min:MIN \
DEF:packetloss=/var/rrd/pingstats.rrd:pl:AVERAGE \
DEF:packetlossma=/var/rrd/pingstats.rrd:pl:MAX \
DEF:packetlossmi=/var/rrd/pingstats.rrd:pl:MIN \
AREA:rtt#00FF00:"Round-trip Time (ms)  " \
GPRINT:rttmi:MIN:"Min\\: %7.3lf%S" \
GPRINT:rtt:AVERAGE:"Avg\\:  %7.3lf%S" \
GPRINT:rttma:MAX:"Max\\:  %7.3lf%S\n" \
LINE2:packetloss#FF0000:"Packet Loss (%)       " \
GPRINT:packetlossmi:MIN:"Min\\:  %7.3lf%S" \
GPRINT:packetloss:AVERAGE:"Avg\\:  %7.3lf%S" \
GPRINT:packetlossma:MAX:"Max\\:  %7.3lf%S"

The RRD definatly gets an integer as the fourth argument, as can be
seen by the output from the script (which I started saving for
debugging purposes), but how is it then possible that I
get floats in the last GPRINTs? I'm probably misunderstanding something
here. I tried to make RRAs with CF MAX, and steps 30, but then I
rrdtool complained about not having an RRA with that particular CF. I
also suspect the rttmax of having an incorrect (compared to what I
expected) value, all the other variables seem to have correct values at
first glance, although I wouldn't be surprised if at least rttmi was
off too.

Could some kind soul perhaps explain why I'm seeing the behaviour above
and not what I'm expecting, or point me to the manual which explains
that.

-- 
Bartosz Oudekerk
   AOLS fortune mod volume VII
   Get yourself a copy at: <URL:http://www.etv.cx/~bartosz>

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list