Autoscale with upper and lower limits.

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
llow
Cacti User
Posts: 170
Joined: Fri Oct 05, 2007 5:34 pm

Autoscale with upper and lower limits.

Post by llow »

I'm not sure if this should be a feature request or considered a bug of RRDTool but without autoscale on the upper and lower limits do not work as well as expected. There is no way right now in Cacti that I know to add --alt-autoscale with the upper and lower limits.

Example:
Without autoscale
/usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="secret - Voltage - Voltage 1" --base=1000 --height=120 --width=500 --upper-limit=3.284 --lower-limit=2.97 --vertical-label="volts" --slope-mode --font TITLE:10: --font AXIS:8: --font LEGEND:8: --font UNIT:8: DEF:a="/opt/cacti-0.8.7-beta4/rra/vg2_phx1_voltage_24.rrd":voltage:AVERAGE \
CDEF:cdefa=a,1000,/ LINE2:cdefa#000000:"Voltage" GPRINT:cdefa:LAST:"Current\:%8.3lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.3lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.3lf %s\n" HRULE:2.97#FF0000:"High Threshold = 2.97\n" HRULE:3.284#FF0000:"Low Threshold = 3.284"

With autoscale
/usr/bin/rrdtool graph - --alt-autoscale --imgformat=PNG --start=-86400 --end=-300 --title="secret - Voltage - Voltage 1" --base=1000 --height=120 --width=500 --upper-limit=3.284 --lower-limit=2.97 --vertical-label="volts" --slope-mode --font TITLE:10: --font AXIS:8: --font LEGEND:8: --font UNIT:8: DEF:a="/opt/cacti-0.8.7-beta4/rra/vg2_phx1_voltage_24.rrd":voltage:AVERAGE \
CDEF:cdefa=a,1000,/ LINE2:cdefa#000000:"Voltage" GPRINT:cdefa:LAST:"Current\:%8.3lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.3lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.3lf %s\n" HRULE:2.97#FF0000:"High Threshold = 2.97\n" HRULE:3.284#FF0000:"Low Threshold = 3.284"
Attachments
Auto Scale
Auto Scale
noautoscale.png (21.98 KiB) Viewed 17671 times
No Auto Scale
No Auto Scale
noautoscale.png (21.98 KiB) Viewed 17671 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Please submit a "Feature Request" at http://www.cacti.net/bugs.php

I believe this was intentional and we will have to investigate the ramifications of this change.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
llow
Cacti User
Posts: 170
Joined: Fri Oct 05, 2007 5:34 pm

Post by llow »

Oops posted same image twice. With Auto Scale attached. I'll create bug.
Attachments
Auto Scale
Auto Scale
autoscale.png (22 KiB) Viewed 17659 times
llow
Cacti User
Posts: 170
Joined: Fri Oct 05, 2007 5:34 pm

Post by llow »

Here is a patch that adds "Use --alt-autoscale (with limits)" as an option.
Attachments
cacti-0.8.7-beta4-autoscale-withlimits.patch
(1.15 KiB) Downloaded 713 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I verified some of those scaling options.
IMHO, it is allowed to define --alt-autoscale and add either or even both of --lower-limit and --upper-limit. Unfortunately, cacti defines --lower-limit=0 and --upper-limit=100 when creating a new graph template. Most graph templates using --alt-autoscale still have these values set.

From rrdtool point of view, correct behaviour would be to always accept --lower-limit and --upper-limit, be it with or without --alt-autoscale.

Unfortunately, this would break most cacti templates (because they are defined wrong with respect to this issue: --lower-limit and --upper-limit should have been empty in most cases).

You've taken this into account when defining an option "auto_scale with limits" which, from rrdtool point of view would be standard behaviour. Doing so may be taken as a valid workaround even if it is not totally "correct".

For a complete implementation as of rrdtool 1.2.23, --alt-autoscale-min and --no-gridfit should be taken into account. But the second one will require a database change.

Please comment

Reinhard
Limits
[-u│--upper-limit value] [-l│--lower-limit value] [-r│--rigid]

By default the graph will be autoscaling so that it will adjust the y-axis to the range of the data.
You can change this behaviour by explicitly setting the limits. The displayed y-axis will then range
at least from lower-limit to upper-limit. Autoscaling will still permit those boundaries to be
stretched unless the rigid option is set.

[-A│--alt-autoscale]

Sometimes the default algorithm for selecting the y-axis scale is not satisfactory. Normally the
scale is selected from a predefined set of ranges and this fails miserably when you need to graph
something like "260 + 0.001 * sin(x)". This option calculates the minimum and maximum y-axis from the
actual minimum and maximum data values. Our example would display slightly less than "260-0.001" to
slightly more than "260+0.001" (this feature was contributed by Sasha Mikheev).

[-J│--alt-autoscale-min]

Where "--alt-autoscale" will modify both the absolute maximum AND minimum values, this option will
only affect the minimum value. The maximum value, if not defined on the command line, will be 0. This
option can be useful when graphing router traffic when the WAN line uses compression, and thus the
throughput may be higher than the WAN line speed.

[-M│--alt-autoscale-max]

Where "--alt-autoscale" will modify both the absolute maximum AND minimum values, this option will
only affect the maximum value. The minimum value, if not defined on the command line, will be 0. This
option can be useful when graphing router traffic when the WAN line uses compression, and thus the
throughput may be higher than the WAN line speed.

[-N│--no-gridfit]

In order to avoid anti-aliasing effects gridlines are placed on integer pixel values. This is by
default done by extending the scale so that gridlines happens to be spaced using an integer number of
pixels and also start on an integer pixel value. This might extend the scale too much for some loga-
rithmic scales and for linear scales where --alt-autoscale is needed. Using --no-gridfit disables
modification of the scale.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest