Dear all,
I'm facing a rather tricky problem (at least for me) and wondering if there's anyone who could point me into the right direction...
The graph I'd like to have contains 2 or 3 datasources where as one is a value between 0 and 100 (relative humidity in this case) and the other two just contain a logical value (0 or 1, the extractor switched on or off).
now I'd like to only draw an area underneath the line when source two is logical 1.
The q&d version just uses a CDEF to multiply times 100, see image attached.
Now I'm wondering if there is a way to exactly colour the area below line1 (e.g. use datasource 1 in a CDEF)???
regards
Rupert
Area with same value as line but different data source
Moderators: Developers, Moderators
Area with same value as line but different data source
- Attachments
-
- graph_image.php.png (33.21 KiB) Viewed 582 times
Re: Area with same value as line but different data source
Correct me if I am wrong but here is how I would do it:
Click on the wrench by your graph. That should show you the command line for graph creation similar to this:
Let's say that in your case DEF:a is for humidity and DEF:b is for extractor. Your current CDEF definition most likely reads cdef=CURRENT_DATA_SOURCE,100,*. So all you have to do is change the 100 to a - cdef=CURRENT_DATA_SOURCE,a,*.
Click on the wrench by your graph. That should show you the command line for graph creation similar to this:
Code: Select all
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="UPS inTC1 - Powerware EMP" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Fahrenheit / %Humidity" \
--slope-mode \
--font TITLE:12:/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf \
--font AXIS:8:/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf \
--font LEGEND:10:/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf \
--font UNIT:8:/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf \
DEF:a="/var/www/html/rra/ups_intc1_emp_temp_70.rrd":EMP_temp:AVERAGE \
DEF:b="/var/www/html/rra/ups_intc1_emp_temp_70.rrd":EMP_temp:LAST \
DEF:c="/var/www/html/rra/ups_intc1_emp_temp_70.rrd":EMP_temp:MIN \
DEF:d="/var/www/html/rra/ups_intc1_emp_temp_70.rrd":EMP_temp:MAX \
DEF:e="/var/www/html/rra/ups_intc1_emp_humidity_69.rrd":EMP_Humidity:AVERAGE \
DEF:f="/var/www/html/rra/ups_intc1_emp_humidity_69.rrd":EMP_Humidity:LAST \
DEF:g="/var/www/html/rra/ups_intc1_emp_humidity_69.rrd":EMP_Humidity:MIN \
DEF:h="/var/www/html/rra/ups_intc1_emp_humidity_69.rrd":EMP_Humidity:MAX \
CDEF:cdefa=a,1.8,*,32,+ \
CDEF:cdefb=b,1.8,*,32,+ \
CDEF:cdefd=d,1.8,*,32,+ \
AREA:cdefa#F51D30FF:"Temperature" \
GPRINT:cdefb:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf %s\n" \
AREA:e#4444FFFF:"Humidity" \
GPRINT:f:LAST:" Current\:%8.2lf %s" \
GPRINT:e:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:h:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:e#000000FF:"" \
LINE1:cdefa#000000FF:""
Re: Area with same value as line but different data source
Hi imro,
I figured out myself that CDEF is using Reverse Polish Notation but didn't know how data sources can be used....
Do you know if there is a good documentation about CDEF
anyway thanks for your hint, worked perfectly.
rupert
Re: Area with same value as line but different data source
I guess you are looking for this:
http://docs.cacti.net/manual:087:6_refe ... cdef#cdefs
http://docs.cacti.net/manual:087:6_refe ... cdef#cdefs
Who is online
Users browsing this forum: No registered users and 2 guests