[drraw-users] Using absolute values in GPRINTs

Peter Lindman peter.lindman at gmail.com
Thu Jan 22 03:25:29 MST 2009


I cannot seem to find a way to configure GPRINTs to print out actual
values in the graphs, they always come with si-units: 2.344k and
3.232k when i want 2344 and 3232. There exists possiblities for
configuring the Y-axis to behave in this way.

I have tracked this problem down to the generation of GPRINT-commands:

(2.2b1 used)

push @ELEM, join(':', 'GPRINT', $vname, @rra, $rranames{$xtras[$i]}
         . "\\: ". $gformat ."%s" . (( $i == $gp ) ? $br : ''));
$i += 1;

Removing "%s" gives me the absolute values i want.

>From rrd-manual:
%s
place this after %le, %lf or %lg. This will be replaced by the
appropriate SI magnitude unit and the value will be scaled accordingly
(123456 -> 123.456 k).

Is there any way to have this configurable as i do not always want the
SI magnitude printed?

And when doing that change, perhaps also make more available in the
GPRINT (ex. units of values) so it is possible to get a line saying:

Energy useage:      Average: 3233 W    Max: 5432 W    Min: 3423 W

My suggestion: Add another configurable line where we can put an
entire format-string for the GPRINTS. If none is provided, use a
default.

So for me to get the line above i would configure the format-string
for that particular graph:
"%5.0lf W"

And for my other traffic-graphs i would have:
"%8.2lf%s" (or a empty field giving the default which in this case is the same)

Best regards
Peter



More information about the drraw-users mailing list