[rrd-users] Temperature diff colors

Johan Elmerfjord jelmerfj at adobe.com
Wed Sep 9 17:36:28 CEST 2015


Hi Martin,

I think you can get some ideas of the following.

I can't test it - so I just took some code that I had in a completely different graph.
But I think the idea is to create different CDEF's according to the temperature intervals.
Then set the color according to this.

Good luck!
/Johan




rrdtool graph ping_${host}_hour.png -h 300 -w 700 -a PNG \
--imginfo '<IMG SRC=/%s WIDTH=%lu HEIGHT=%lu >' \
--start -28800 --end -60  \
-v "Round-Trip Time (ms)" \
--rigid \
--lower-limit 0 \
--title "Ping statistics: $host" \
DEF:rtt=${host}_rtt.rrd:ds0:AVERAGE \
DEF:rtt_min=${host}_rtt_min.rrd:ds0:MIN \
DEF:rtt_max=${host}_rtt_max.rrd:ds0:MAX \
DEF:ploss=${host}_packet_loss.rrd:ds0:AVERAGE \
CDEF:rtt_diff=rtt_max,rtt_min,- \
CDEF:PLNone=ploss,0,0,LIMIT,UN,UNKN,INF,IF \
CDEF:PL10=ploss,1,10,LIMIT,UN,UNKN,INF,IF \
CDEF:PL25=ploss,10,25,LIMIT,UN,UNKN,INF,IF \
CDEF:PL50=ploss,25,50,LIMIT,UN,UNKN,INF,IF \
CDEF:PL75=ploss,50,75,LIMIT,UN,UNKN,INF,IF \
CDEF:PL100=ploss,75,100,LIMIT,UN,UNKN,INF,IF \
COMMENT:"(Packet Loss Percentage)" \
AREA:PLNone#FFFFFF:"0%": \
AREA:PL10#FFFF00:"0-10%": \
AREA:PL25#CCEE00:"10-25%": \
AREA:PL50#BBB000:"25-50%": \
AREA:PL75#FFD000:"50-75%": \
AREA:PL100#FF0000:"75-100%": \
COMMENT:"\n" \
LINE1:rtt_min#3030ff \
AREA:rtt_diff#a0a0ff::STACK \
LINE1:rtt_max#3030ff \
LINE1:rtt_min#3030ff \
LINE2:rtt#0000ff:${host} \
GPRINT:rtt:LAST:"Cur\: %5.2lf" \
GPRINT:rtt:AVERAGE:"Avg\: %5.2lf" \
GPRINT:rtt:MAX:"Max\: %5.2lf" \
GPRINT:rtt:MIN:"Min\: %5.2lf\n"





On Wed, 2015-09-09 at 16:34 +0200, Martin wrote:


Hello all,

I´m wondering if anyone has a code example for showing diffrent colors
in a graph depending on temperatue like this, if it above +0 and up the
color is red and if its below -0 its blue ?

cheers //M

_______________________________________________
rrd-users mailing list
rrd-users at lists.oetiker.ch<mailto:rrd-users at lists.oetiker.ch>
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20150909/77069d91/attachment.html>


More information about the rrd-users mailing list