[rrd-users] Get DS:MAX without MAX RRA
Steve Shipway
s.shipway at auckland.ac.nz
Wed Nov 3 09:17:52 CET 2010
Why not do it in two steps?
First, make a call to RRDs::fetch to obtain the min and max values of the value you want to graph over the time period in question.
Second, use these values to calculate a round number to use as min/max.
Third, use your preferred temperature min/max to calculate an appropriate scaleshift for the humidity; if the temp is from A to B, then set scaleshift for the second axis to (100/(B-A)):-A and have the second value display as (X/100*(B-A)+A)
This should achieve what you want. Of course, you cant do it from rrdcgi, but if you're generating the graph programmatically from the libraries it shouldnt be a problem.
Steve
Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz
Ph: +64 9 373 7599 ext 86487
________________________________________
From: rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch [rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of Matt Elias [m_elias at fastmail.fm]
Sent: Wednesday, 3 November 2010 4:21 p.m.
To: rrd-users at lists.oetiker.ch
Subject: [rrd-users] Get DS:MAX without MAX RRA
I would like to display two data definitions on one graph, temperature
and humidity. I would like to get the main Y axis (temperature) scale to
remain automatic (or manually set a little lower than the min and a
little higher than the max) and the right axis (humidity) scale at the
same scale (ie 0 - 100). My initial thoughts are that if I can get the
graph's min and max temperature values, then maybe I can use that to
scale the Y axis and use a formula to scale the humidty values
accordingly so that they match the right axis' 0-100 scale. The min and
max values I need are similar to the MAX and MIN values that are
displayed in the GPRINT paramenters:
"LINE1:Temp#32CD32:Temperature C",
"GPRINT:Temp:MAX: Max\\: %5.1lf %s",
"GPRINT:Temp:AVERAGE:Avg\\: %5.1lf %s",
"GPRINT:Temp:MIN:Min\\: %5.1lf %s",
"GPRINT:Temp:LAST:Last\\: %5.1lf %s\\l",
If something like this is not doable from within RRDtool, then I may log
additional data to a log file and have my graph generating perl script
use that log file to manipulate the Y axis scales.
Matt
_______________________________________________
rrd-users mailing list
rrd-users at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
More information about the rrd-users
mailing list