[rrd-users] Re: Problem with gprinting kilos(10e3) only

Alex van den Bogaerdt alex at ergens.op.het.net
Thu Oct 20 12:41:36 MEST 2005


On Thu, Oct 20, 2005 at 12:13:58PM +0200, Piotr Szafran wrote:
> Hi,
> 
> i am trying to gprint below the graph the some statistics, but i want 
> them printed always as kilo (10e3), for example 12000 k instead of 12M. 
> There is no problem to that on y-axis with units-exponent option, but 
> this doesn't change the printed values. How can i change this??
> 
> rrdtool graph a.png  -Y -X 3 --lower-limit 0 -s now-72h
> DEF:bytes_in=$rrd:in:AVERAGE
> DEF:bytes_out=$rrd:out:AVERAGE
> CDEF:bits_out=bytes_out,8,*
> CDEF:bits_in=bytes_in,8,*
> GPRINT:bits_in:MAX:'%2.3lf %s' 
> GPRINT:bits_in:AVERAGE:'%7.7lg %s' 
> GPRINT:bits_out:MAX:'%0.3lf %s'
> GPRINT:bits_out:AVERAGE:'%lf %S'
> AREA:bits_in#00FF00:Download LINE1:bits_out#0000FF:Upload

try this:

 CDEF:kilobit_in=bytes_in,8,*,1000,/
 GPRINT:kilobit_in:MAX:'%5.0lf k'

  '%5.0lf k'   for 10000 k
  '%7.1lf k'   for  9999.9 k
  '%8.2lf k'   for  9999.99 k
  '%9.3lf k'   for  9999.999 k
  '%6.0lf k'   for 100000 k
  '%8.1lf k'   for  99999.9 k
and so on.

-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list