[mrtg] Support for secondary y-axis in Routers2

Steve Shipway s.shipway at auckland.ac.nz
Wed Apr 22 01:16:47 CEST 2009


After being asked for this for several years, it is now possible (with RRDtools 1.3.x) and so I've implemented it.  This is still beta and experimental of course.

The secondary-Y-axis support works in Routers2 v2.20beta6 and later, when using RRDtools 1.3.4 and later.  Props to Tobi for adding the required functions to the library.

Routers2 now puts the 'outgoing' metric on the secondary axis and the 'incoming' on the primary.  Notably 'fixunit' seems not to work on the secondary axis due to the RRDtool library behaviour.

The new syntax is:
routers.cgi*Ylegend2[ezwf]: Secondary axis
routers.cgi*ScaleShift[ezwf]: 2:0
which creates a second axis labelled 'Secondary axis', which is scaled by a factor of 2 (IE, it goes from 0-200 if the primary axis is from 0-100) and shifted by 0 (the shift is the value the axis starts at).

For example, if you had humidity (0-100) and temperature (20-40) on the graph, you'd use a scaleshift of 0.2:20

On userdefined graphs, this currently doesn't work; I'm not sure if it would be better to keep the in/out split or to have component Targets completely on one scale or the other via a special per-target option.

Why am I posting it here?  Well partly because I'm feeling smug that it worked almost bug-free from the first but, but mainly because I'd like to hear from anyone willing to run some tests for me.  So, if you'd like to beta-test this, please let me know.  Also, if you have any thoughts on how you'd prefer to see the multi-axis support work on userdefined graphs, let me know.

Routers2 v2.20 is due for release as soon as this seems stable enough, and a new 2nd Edition of the book will contain all the new directives.
http://www.steveshipway.org/book/ if you want a copy...

Thanks for your time,

Steve



More information about the mrtg mailing list