[rrd-users] Scaling the y-axsis

Steve Shipway s.shipway at auckland.ac.nz
Wed Aug 5 05:44:55 CEST 2009


> As far as I can understand the rrdtool graph function does not support
> this directly. So my approach now is to get the max and min values in the
> selected time window and add 15 to max and subtract 15 from min, then set
> upper-limit and lower-limit accordingly.

So, what I think you want to do is to set a maximum upper-limit and a minimum lower-limit but allow autoscaling between this?

RRDtool lets you do the opposite (specify a minimum upper limit and maximm lower limit and allow scaling outside) but not this - at least, not directly.

What I would suggest is that you use a CDEF on your variable to clip it to the maximum range you want, and then you'll have it.

'var' is your variable.  We're limiting it to the 0-100 range.

CDEF:newvar=var,0,LT,0,var,IF,dup,100,GT,EXC,100,EXC,IF

Now graph newvar.  Make use to use 'var' in your VDEFs and not 'newvar', though, else you'll not get the correct calculations.

Steve, blackbelt in RPN-fu :)



More information about the rrd-users mailing list