[rrd-users] find out the current scale (output from autoscaler)

Scott Brumbaugh scottb at prolexic.com
Fri Jan 9 02:45:59 CET 2009


Hi Karl,

Karl Fischer wrote:
> Happy New Year to everyone.
> 
> 
> Is there a way to find out what the current (y) scale is?
> 
> I'm trying to display some values only if they fit the current scale but
> I don't want these values to extend the current scale.
> For example when watching disk usage I'd like to show a line for disk
> capacity when (and only when) disk usage gets near the disk capacity.
> But I don't want the scale to be extended to - lets say 100G - when only
> 1.83 GB is used ...
> 
> So what I've tried so far is:
> 
> CDEF:my_scale=df_used,MAX,1.2,*
> CDEF:my_total=df_total,0,my_scale,LIMIT
> 
> So I'm 'guessing' the current scale is about 20% higher than the highest value.
> But it would be much nicer to get the values from the autoscaler ...
> Any way?
> 
> 
> Thanks
> 
> - Karl
> 

This won't do exactly what you want but has helped us with scaling
issues.  Maybe it will help someone else.

We can use the VDEF and PRINTS functions to get a numeric readout of the
peaks in our timeseries using the rrd_graph function.

We define DEFS as usual,

 DEF:BytesIn_28=ifHCInOctets.28.rrd:BytesIn:AVERAGE
 DEF:BytesIn_6=ifHCInOctets.6.rrd:BytesIn:AVERAGE
 DEF:BytesIn_31=ifHCInOctets.31.rrd:BytesIn:AVERAGE
 ...

Then some VDEFS that calculate the maximums,

 VDEF:BytesIn_28_max=BytesIn_28,MAXIMUM
 VDEF:BytesIn_6_max=BytesIn_6,MAXIMUM
 VDEF:BytesIn_31_max=BytesIn_31,MAXIMUM
 ...

and use PRINT to get the results,

 PRINT:BytesIn_28_max:curve oid ifHCInOctets iid 28 %.3lf
 PRINT:BytesIn_6_max:curve oid ifHCInOctets iid 6 %.3lf
 PRINT:BytesIn_31_max:curve oid ifHCInOctets iid 31 %.3lf
 ...

If we call rrd_graph (perl bindings) like this,

 @max = RRDs::graph('/dev/null', ..., @DEFS, @VDEFS, @PRINTS);

The result @max contains the peak values for all the timeseries,

 curve oid ifHCInOctets iid 28 2195.571
 curve oid ifHCInOctets iid 6 92099111.699
 curve oid ifHCInOctets iid 31 975549.175
 ...

We actually run against graphs with 1000's of DEFS.  We can run
processing against the PRINT outputs and identify peaks efficiently.


Scott B





More information about the rrd-users mailing list