[rrd-users] Create Graph with 2 "AREA"

Martin Friberg martin at swetech.se
Fri Aug 17 22:35:34 CEST 2012


Hey Simon

yes itried that but for some reason it still goes up on the axis



code to generate the db

$RRDTOOL create $FILE -s 60 \
DS:ping:GAUGE:120:0:65535 \
RRA:AVERAGE:0.5:1:2880


code to update db

UPDATECMD=$(ping -c 3 -w 6 $HOST | grep rtt | awk -F "/" '{ print $5 }' )
$RRDTOOL update $FILE N:$UPDATECMD

UPDATECMD2=$(ping -c 3 -w 6 $HOST2 | grep rtt | awk -F "/" '{ print $5 * 
-1 }' )

$RRDTOOL update $FILE N:$UPDATECMiD2

code to generate graph

$RRDTOOL graph $OUTPUT \
         -t "WAN Ping" -v "Time in ms" \
         --start="now-1d" \
         --end="now" \
         --height="320" \
         --width="640" \
         -c "BACK#000000" \
         -c "SHADEA#000000" \
         -c "SHADEB#000000" \
         -c "FONT#DDDDDD" \
         -c "CANVAS#202020" \
         -c "GRID#666666" \
         -c "MGRID#AAAAAA" \
         -c "FRAME#202020" \
         -c "ARROW#FFFFFF" \
         "DEF:ping_time=$FILE:ping:AVERAGE" \
         "CDEF:shading2=ping_time,0.98,*" "AREA:shading2#F90000:$HOST" \
         "CDEF:shading3=ping_time,0.98,*" "AREA:shading3#fff000:$HOST2" \
         "GPRINT:ping_time:LAST:Last\: %5.2lf ms" \
         "GPRINT:ping_time:MIN:Min\: %5.2lf ms" \
         "GPRINT:ping_time:MAX:Max\: %5.2lf ms" \
         "GPRINT:ping_time:AVERAGE:Avg\: %5.2lf ms" \
         "CDEF:shading10=ping_time,0.90,*" "AREA:shading10#E10000" \
         "CDEF:shading15=ping_time,0.85,*" "AREA:shading15#D20000" \
         "CDEF:shading20=ping_time,0.80,*" "AREA:shading20#C30000" \
         "CDEF:shading25=ping_time,0.75,*" "AREA:shading25#B40000" \
         "CDEF:shading30=ping_time,0.70,*" "AREA:shading30#A50000" \
         "CDEF:shading35=ping_time,0.65,*" "AREA:shading35#960000" \
         "CDEF:shading40=ping_time,0.60,*" "AREA:shading40#870000" \
         "CDEF:shading45=ping_time,0.55,*" "AREA:shading45#780000" \
         "CDEF:shading50=ping_time,0.50,*" "AREA:shading50#690000" \
         "CDEF:shading55=ping_time,0.45,*" "AREA:shading55#5A0000" \
         "CDEF:shading60=ping_time,0.40,*" "AREA:shading60#4B0000" \
         "CDEF:shading65=ping_time,0.35,*" "AREA:shading65#3C0000" \
         "CDEF:shading70=ping_time,0.30,*" "AREA:shading70#2D0000" \
         "CDEF:shading75=ping_time,0.25,*" "AREA:shading75#180000" \
         "CDEF:shading80=ping_time,0.20,*" "AREA:shading80#0F0000" \
         "CDEF:shading85=ping_time,0.15,*" "AREA:shading85#000000" 
 >/dev/null




gives the result
http://212.116.73.172/nerd/sunet2.png







Simon Hobson skrev 2012-08-17 20:31:
> Martin Friberg wrote:
>
>> i been playing around with rrd and create myself a graph from ping 2
>> diffrent sites ( http://212.116.73.172/nerd/sunet.png )
>>
>> now my question is if anyone knows how i can get it do draw a "AREA"
>> down for the second host (yellow one) like it does for the red one kinda
>> like http://oss.oetiker.ch/rrdtool/gallery/charles.png
>
> You mean plot one host up from teh axis, and the other down from the 
> axis ?
> Just multiply the values for one of them by "-1".
>



More information about the rrd-users mailing list