[rrd-users] Newb to rrdtool ;-)

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Mar 25 02:55:04 CET 2008


On Mon, Mar 24, 2008 at 09:37:57PM -0400, Drew Weaver wrote:
> Hi, I've been using mrtg for quite some time, but I'm trying to use rrdtool for the first time.
> 
> What I have is a service which sends me pings to my equipment, they send me a min, an avg, and a max, I would like to store the min, avg, and max, and then graph them.
> 
> I've created the rrd file with the 3 entries for min avg and max, for 900 second intervals, and I've gotten my script to automatically insert into the script, the main issue is pulling the data from the rrd via rrdtool graph.
> 
> Is there any good examples of a very simple rrdtool graph for a multi line gauge?
> 
> I just need to graph min avg and max ms.

Then you need to cut away what you don't need:

set $1 to devicename
set $2 to day or week or month or year
set $3 to amount of time
set $4 to amount of pixel columns
set $5 to "-o" if you want a logaritmic scale

rrdcommand = rrdtool graph $1-$2.png \
        --title $1\ $2\
        --start end-$3 --end now \
        --width $4 $5 \
        DEF:kmin1=rtt_$1.rrd:rttmin:MIN \
        DEF:kmin2=rtt_$1.rrd:rttmin:AVERAGE \
        DEF:kmin3=rtt_$1.rrd:rttmin:MAX \
        DEF:kavg1=rtt_$1.rrd:rttavg:MIN \
        DEF:kavg2=rtt_$1.rrd:rttavg:AVERAGE \
        DEF:kavg3=rtt_$1.rrd:rttavg:MAX \
        DEF:kmax1=rtt_$1.rrd:rttmax:MIN \
        DEF:kmax2=rtt_$1.rrd:rttmax:AVERAGE \
        DEF:kmax3=rtt_$1.rrd:rttmax:MAX \
        DEF:exitcode1=rtt_$1.rrd:exitcode:MIN \
        DEF:exitcode2=rtt_$1.rrd:exitcode:AVERAGE \
        DEF:exitcode3=rtt_$1.rrd:exitcode:MAX \
        DEF:lostping1=rtt_$1.rrd:lostping:MIN \
        DEF:lostping2=rtt_$1.rrd:lostping:AVERAGE \
        DEF:lostping3=rtt_$1.rrd:lostping:MAX \
        CDEF:min1=kmin1,ISINF,UNKN,kmin1,IF,1000,/ \
        CDEF:min2=kmin2,ISINF,UNKN,kmin2,IF,1000,/ \
        CDEF:min3=kmin3,ISINF,UNKN,kmin3,IF,1000,/ \
        CDEF:avg1=kavg1,ISINF,UNKN,kavg1,IF,1000,/ \
        CDEF:avg2=kavg2,ISINF,UNKN,kavg2,IF,1000,/ \
        CDEF:avg3=kavg3,ISINF,UNKN,kavg3,IF,1000,/ \
        CDEF:max1=kmax1,ISINF,UNKN,kmax1,IF,1000,/ \
        CDEF:max2=kmax2,ISINF,UNKN,kmax2,IF,1000,/ \
        CDEF:max3=kmax3,ISINF,UNKN,kmax3,IF,1000,/ \
        CDEF:mind=min3,min1,- \
        CDEF:avgd=avg3,avg1,- \
        CDEF:maxd=max3,max1,- \
        CDEF:exitcoded=exitcode3,exitcode1,- \
        CDEF:lostpingd=lostping3,lostping1,- \
        VDEF:omin=min1,MINIMUM \
        VDEF:oavg=avg2,AVERAGE \
        VDEF:omax=max3,MAXIMUM \
        VDEF:oexitcode=exitcode3,MAXIMUM \
        VDEF:olostping=lostping3,MAXIMUM \
        AREA:min1 AREA:mind\#0000FF80::STACK \
        AREA:max1 AREA:maxd\#FF000080::STACK \
        AREA:avg1 AREA:avgd\#00CC0080::STACK \
        AREA:exitcode1 AREA:exitcoded\#FFFF0080::STACK \
        AREA:lostping1 AREA:lostpingd\#FFFF0080::STACK \
        LINE:min2\#0000FF:rttmin GPRINT:omin:%7.3lf' (min)'\\n \
        LINE:max2\#FF0000:rttmax GPRINT:omax:%7.3lf' (max)'\\n \
        LINE:avg2\#00CC00:rttavg GPRINT:oavg:%7.3lf' (avg)'\\n \
        LINE:exitcode3\#FFFF00:exitcode GPRINT:oexitcode:%5.0lf' (max)'\\n \
        LINE:lostping3\#000000:lostping GPRINT:olostping:%5.0lf' (max)'\\n \


-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list