Get DS:MAX without MAX RRA

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Get DS:MAX without MAX RRA

m_elias
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
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: Get DS:MAX without MAX RRA

S Shipway
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
[hidden email]
Ph: +64 9 373 7599 ext 86487


________________________________________
From: rrd-users-bounces+s.shipway=[hidden email] [rrd-users-bounces+s.shipway=[hidden email]] on behalf of Matt Elias [[hidden email]]
Sent: Wednesday, 3 November 2010 4:21 p.m.
To: [hidden email]
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
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: Get DS:MAX without MAX RRA

m_elias
So after writing up a perl script to parse rrdtool fetch data I found
out here http://oss.oetiker.ch/rrdtool/forum.en.html#nabble-td1072180 
that a rrdtool graph with only DEF and PRINT elements will spit out
those print strings without actually creating the graph file. So I'm
parsing those PRINT string dumps to get my min/max values. Then after
modifying/correcting Steve's suggestion formula my humidity line and
right axis stay steady while my Y axis manually  scales  to the min and
max temperature (manual, auto scaling). To get the correct formula I had
to calculate through some simple values and I ended up with:

     my $rascale = 100/($max - $min);
     my $rashift = -1 * $min * $rascale;

to calculate the scale and offset shift and:

     "--right-axis", "$rascale:$rashift",
     "DEF:Hum=$rrd/Weather.rrd:OutHum:AVERAGE",
     "CDEF:sHum=Hum,100,/,$max,$min,-,*,$min,+",

to setup rrdtool graph.

thanks for the help Steve,
Matt


On 11/3/2010 3:17 AM, Steve Shipway wrote:

> 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
> [hidden email]
> Ph: +64 9 373 7599 ext 86487
>
>
> ________________________________________
> From: rrd-users-bounces+s.shipway=[hidden email] [rrd-users-bounces+s.shipway=[hidden email]] on behalf of Matt Elias [[hidden email]]
> Sent: Wednesday, 3 November 2010 4:21 p.m.
> To: [hidden email]
> 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
> [hidden email]
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Windows 1.2.30 -> 1.4.4 - file format change?

Dave Whitehead-2
Hi

I found a site with a binary of RRD 1.4.4 for Windows, downloaded this
and it runs ok.

However when I try and access a RRD file that is being maintained by RRD
1.2.30 (the only other binary for Windows I could find) it says ...

        "ERROR: 'kwh.rrd' is too small (should be 9534384 bytes)"

I assume there is a file format change between the 2 versions.....the
question is how do I switch over to use 1.4.4 everywhere - what do I
need to do to my existing RRDs to allow 1.4.4 to work with them?

Many thanks
Dave


-----------------------------------------

Please print responsibly

Marwell Wildlife is a limited liability company registered in England and Wales under number 1355272.
VAT No. 631 9661 30. The company is a registered charity, number 275433

Registered office: Marwell Wildlife, Colden Common, Winchester, Hampshire, SO21 1JH.

Opinions expressed in this e-mail are those of the individual, not the company unless specifically indicated to that effect. This e-mail and any attachments are confidential and solely for the use of the intended recipient. If you are not the intended recipient we apologise for any inconvenience. Please return to the sender. Any use or copying is strictly prohibited.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: Windows 1.2.30 -> 1.4.4 - file format change?

oetiker
Administrator
Hi Dave,

Today Dave Whitehead wrote:

> Hi
>
> I found a site with a binary of RRD 1.4.4 for Windows, downloaded this
> and it runs ok.
>
> However when I try and access a RRD file that is being maintained by RRD
> 1.2.30 (the only other binary for Windows I could find) it says ...
>
> "ERROR: 'kwh.rrd' is too small (should be 9534384 bytes)"
>
> I assume there is a file format change between the 2 versions.....the
> question is how do I switch over to use 1.4.4 everywhere - what do I
> need to do to my existing RRDs to allow 1.4.4 to work with them?

there is a format change ... BUT newer versions of rrdtool can read
the old file as you stick with the same platform. In windows land,
different compiler options can cause rrdtool to produce different
binary represenations.

It seems that your 1.4.4 binary is such a case ... by compiling
rrdtool 1.4.4 with the same settings as 1.2 will give you a
compatible binary.

cheers
tobi

> Dave
>
>
> -----------------------------------------
>
> Please print responsibly
>
> Marwell Wildlife is a limited liability company registered in England and Wales under number 1355272.
> VAT No. 631 9661 30. The company is a registered charity, number 275433
>
> Registered office: Marwell Wildlife, Colden Common, Winchester, Hampshire, SO21 1JH.
>
> Opinions expressed in this e-mail are those of the individual, not the company unless specifically indicated to that effect. This e-mail and any attachments are confidential and solely for the use of the intended recipient. If you are not the intended recipient we apologise for any inconvenience. Please return to the sender. Any use or copying is strictly prohibited.
>
> _______________________________________________
> rrd-users mailing list
> [hidden email]
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [hidden email] ++41 62 775 9902 / sb: -9900

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: Windows 1.2.30 -> 1.4.4 - file format change?

Dave Whitehead-2
Aha...!

Sadly I don't have the facilities to recompile 1.4.4 (even if I knew
what the settings were). Is there no way to convert (onetime) the
existing RRD to new format? Could I dump the data out using 1.2 and
import in some way to a new RRD created with 1.4?

Many thanks
dave


-----Original Message-----
From: Tobias Oetiker [mailto:[hidden email]]
Sent: 04 November 2010 09:39
To: Dave Whitehead
Cc: [hidden email]
Subject: Re: [rrd-users] Windows 1.2.30 -> 1.4.4 - file format change?

Hi Dave,

Today Dave Whitehead wrote:

> Hi
>
> I found a site with a binary of RRD 1.4.4 for Windows, downloaded this
> and it runs ok.
>
> However when I try and access a RRD file that is being maintained by
RRD
> 1.2.30 (the only other binary for Windows I could find) it says ...
>
> "ERROR: 'kwh.rrd' is too small (should be 9534384 bytes)"
>
> I assume there is a file format change between the 2 versions.....the
> question is how do I switch over to use 1.4.4 everywhere - what do I
> need to do to my existing RRDs to allow 1.4.4 to work with them?

there is a format change ... BUT newer versions of rrdtool can read
the old file as you stick with the same platform. In windows land,
different compiler options can cause rrdtool to produce different
binary represenations.

It seems that your 1.4.4 binary is such a case ... by compiling
rrdtool 1.4.4 with the same settings as 1.2 will give you a
compatible binary.

cheers
tobi

> Dave
>
>
> -----------------------------------------
>
> Please print responsibly
>
> Marwell Wildlife is a limited liability company registered in England
and Wales under number 1355272.
> VAT No. 631 9661 30. The company is a registered charity, number
275433
>
> Registered office: Marwell Wildlife, Colden Common, Winchester,
Hampshire, SO21 1JH.
>
> Opinions expressed in this e-mail are those of the individual, not the
company unless specifically indicated to that effect. This e-mail and
any attachments are confidential and solely for the use of the intended
recipient. If you are not the intended recipient we apologise for any
inconvenience. Please return to the sender. Any use or copying is
strictly prohibited.
>
> _______________________________________________
> rrd-users mailing list
> [hidden email]
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [hidden email] ++41 62 775 9902 / sb: -9900

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users