Autoscale with a fixed minimum. Or

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
Alain Tesio

Autoscale with a fixed minimum. Or

Post by Alain Tesio »

Hi, I'd like to use the autoscale option for graphics but still keep the minimum at 0 (so an area twice bigger really means a value twice bigger)
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Yeah, I think that would be really cool too. I can think of a few situtions where it would make graphs looks nicer. Do you know if rrdtool can do this though? If it can, it should not be a problem for cacti to support it.

-Ian
Alain Tesio
Posts: 7
Joined: Sat Oct 19, 2002 5:16 pm
Location: Paris, France
Contact:

Post by Alain Tesio »

Hi, it's supported by rrdtool, the option --alt-autoscale-max only autoscales the maximum value, so you should set the configured lower limit, see the patch below.

Another problem in rrdtool is that the man page says that the default lower limit is 0, but using alt-autoscale-max with no explicit lower limit autoscales the lower limit anyway.

Code: Select all

*** include/rrd_functions.php.orig      Sat Oct 19 16:57:19 2002
--- include/rrd_functions.php   Sat Oct 19 17:02:23 2002
***************
*** 362,367 ****
--- 362,368 ----
                                break;
                        case "2":
                                $scale .= "--alt-autoscale-max" . " \\\n";
+                               $scale = "--lower-limit=" . mysql_result($sql_id, 0, "upperlimit") . " \\\n";
                                break;
                }
Alain Tesio
Posts: 7
Joined: Sat Oct 19, 2002 5:16 pm
Location: Paris, France
Contact:

Post by Alain Tesio »

Sorry it's the wrong column in the mysql query
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

I don't understand the disscusion I guess. Why don't you just use "--alt-autoscale-max" option in cacti Graph Configuration along with "Lower Limit" field? Seems to be simpler than patching the code.

- bulek
Alain Tesio
Posts: 7
Joined: Sat Oct 19, 2002 5:16 pm
Location: Paris, France
Contact:

Post by Alain Tesio »

That's the problem, if I do what you write cacti doens't run rrdgraph with the lower-limit option, my patch fixes this.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

You are right, I've never noticed this. Good point!

Shouldn't your added line be the following (two changes in red)?

$scale .= "--lower-limit=" . mysql_result($sql_id, 0, "lowerlimit") . " \\\n";

- bulek
Alain Tesio
Posts: 7
Joined: Sat Oct 19, 2002 5:16 pm
Location: Paris, France
Contact:

Post by Alain Tesio »

yes sure !
Guest

Post by Guest »

THX a lot for this patch :)

Now the option "--alt-autoscale-max" works fine.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest