[rrd-users] Dynamic Background

Jan Mara jan.mara at krankikom.de
Mon Dec 19 11:33:50 CET 2011


Am 16.12.11 19:47, schrieb Simon Hobson:
> Jan Mara wrote:
>
>> just a quick question is there any way to implement a dynamic background
>> color based on lets say MAX or MIN Datasource values?
> You mean something like, if max load is >70% then shade the 
> background pale red, if it's over 90% then shade the background 
> bright red ?
>
> This can be "fudged", but only for the data area of the graph, by 
> drawing an area in the colour you want before drawing the real data. 
> If you want it to vary across the X axis depending on the data, then 
> you can do something along the lines of :
>
> if <val> > <some value>
>    then x=<max value>
>    else x=unknown
> and then plot x as an area. I think it would be something like this :
>
> DEF:val= ....
>
> CDEF:background=val,${limit},GT,${max},UNKN,IF
>
> AREA:background ...
> LINE:val ...
>
> Where limit and max are values computed separately prior to calling 
> rrd tool to draw the graph.
>
>
> Also, there are options to change the colour of the graph elements, 
> see "-c|--color" in http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html
>
>
Thanks for the hint, I'll try that out. In the meantime I've added a
little snipplet which does a "rrdtool fetch" and selects the overall max
value and switches the background before creating the graph. Its not
that nice ;-) but does the trick to the background instead of the graph
area.

Cheers,
    Jan M.

-- 
Jan Mara | +49-203/3059767 | jan.mara at krankikom.de
_____________________________________________________________________
KRANKIKOM Alexander Kranki Kommunikation GmbH
Schifferstraße 200   | D-47059 Duisburg  |  Germany
AG Duisburg HRB 6669 | Ust.-Ident.-Nr. DE811853024
Geschäftsführer: Alexander Kranki, Holger Ruhfus

www.krankikom.de



More information about the rrd-users mailing list