2 distinct y-axis in one graph?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
alexs77
Posts: 41
Joined: Tue May 26, 2009 7:31 am
Location: Winterhtur, Switzerland

2 distinct y-axis in one graph?

Post by alexs77 »

Hello!

I'd like to plot 2 curves in a graph. But those 2 curves should NOT share the same y-axis.

Eg. I'd like to plot the CPU Usage (idle) values of "ucd 00 CPU Solaris (enhanced)" which are always in the range 0-100 (because it's a percentage value) - and it's typcially in the higher range of 90-100. And in the same graph, I'd like to show eg. the 5 minutes load average from "ucd 01 Load Average", which is (on my systems) typically in the range 0-2.

If I'd plot those two curves on the same graph, then there'd be a (more or less) flat line at about 1 for the load and another flat line at 90-100 for CPU usage. That wouldn't tell much.

Now, if it were possible to have distinct y-axis for both graphs, then I could set y1 to 90-100 and y2 to 0-2 and see more.

Can this be done with Cacti? Oh, and if it were possible to have y1 be logarithmic and y2 not, then that would be even better! :)

BTW: That was just an example so that everybody should be able understand it with "publically available" values. In reality, y1 would still be CPU usage with 0-100 (%) but y2 would be some self derived value showing "application performance", measured in 1000-10000 (and best be shown in log.).

Thanks a lot,
Alexander
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: 2 distinct y-axis in one graph?

Post by BSOD2600 »

alexs77 wrote:Can this be done with Cacti? Oh, and if it were possible to have y1 be logarithmic and y2 not, then that would be even better!
The real question is if RRDTOOL can do this -- since this is what cacti uses to create/store the graphs.

Find how to accomplish this in the rrdtool manual/mailing list and then you can file a feature request.
alexs77
Posts: 41
Joined: Tue May 26, 2009 7:31 am
Location: Winterhtur, Switzerland

--right-axis

Post by alexs77 »

Hi.

In the RRDgraph manual, I found:
[--right-axis scale:shift] [--right-axis-label label]

A second axis will be drawn to the right of the graph. It is tied to the left axis via the scale and shift parameters. You can also define a label for the right axis.

[--right-axis-format format-string]

By default the format of the axis lables gets determined automatically. If you want todo this your self, use this option with the same %lf arguments you know from the PRING and GPRINT commands.
So it should be possible. I haven't checked yet, but I'd assume that this would conflict with auto scaling.

But given that there's only ONE upper-limit and lower-limit option, I'm confused on how to set the left y-axis to eg. 0..100 and the right y-axis to 1000..10000.

Any ideas?

Thanks a lot,
Alexander
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Appears its a recent new feature, 1.2.29, I believe. Wouldn't hurt to create the feature request in Cacti (if its not already requested) though. www.cacti.net/bugs.php

Per Tobias Oetiker,
you have todo the scaling of the graphs yourself, using CDEF. So if
one line is in the 100 thousands, then you do a CDEF:b=a,1000,/ and
draw b ... along with setting the scaling factor for the right axis
to 0.001
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Yes, please log this feature. I have waited on it for long enough. Might as well have it in Cacti.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I vote yes.... But... Oh man, what a pain to do version checking for....
[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]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

rony wrote:I vote yes.... But... Oh man, what a pain to do version checking for....
Yep. Well said. "unfortunately", some 1.3.x stuff was backported to 1.2.x. And now, 1.4 is on the run.
Unfortunately, the 2nd y-axis refers to the first one. From my point of understanding, this makes things more complicated ...
Reinhard
transisco
Posts: 1
Joined: Tue Jul 14, 2009 1:52 am

Post by transisco »

Yes, this would be very useful. I'd vote for it also. Version checking would be a a bit harder but it's a matter of running "rrdtool" and parsing it's output. Perhaps to make things easier for the folks who really want this feature, could you integrate in a custom rrdtool flags field?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

transisco wrote:Yes, this would be very useful. I'd vote for it also. Version checking would be a a bit harder but it's a matter of running "rrdtool" and parsing it's output.
Bah, that's easy.
But can you imagine the table for all current rrdtool options, parameters and stuff having a separate column for each release? That will be about 30 columns! And do you know a single place where to find the information, which exact parameter was introduced an which exact rrdtool release?
If anyone provides me with that table, I will implement it in the next cacti main release!
Perhaps to make things easier for the folks who really want this feature, could you integrate in a custom rrdtool flags field?
That was indeed suggested from time to time. Until now, we refrain from doing so because this may break compatibilty between cacti versions (and perhaps between rrdtool versions).
Having the table as a start would allow for easier integration of new features.
Reinhard
Lobz
Posts: 1
Joined: Fri Mar 18, 2011 1:20 pm

Re: 2 distinct y-axis in one graph?

Post by Lobz »

Is there any way at all to do this while using cacti?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: 2 distinct y-axis in one graph?

Post by gandalf »

Not yet. This feature is already part of 088, but this version is pre-alpha
R.
User avatar
classen
Cacti User
Posts: 116
Joined: Thu Nov 12, 2009 3:07 pm

Re: 2 distinct y-axis in one graph?

Post by classen »

is this feature in 0.8.8a ?

Thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: 2 distinct y-axis in one graph?

Post by gandalf »

No, postponed to 089 which is currently under development.
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest