[rrd-users] The Y-Axis is Displaying an Incorrect Unit

Steve Shipway s.shipway at auckland.ac.nz
Mon Apr 21 23:31:52 CEST 2014

Of course, you can do this in RRDTool.

If your RRD holds values in K, then you just need to multiply these by 1024
before graphing and they will display correctly.  Similarly you can multiple
by 1024000 to convert from MB to bytes.

The next question, of course, is going to be 'how do I do this in

In your template, you'll need to add something like this ...

$def[0] .=  rrd::def("kbytes",$RRDFILE[0],$DS[0],"AVERAGE ") ;
$def[0] .= rrd::cdef("bytes","kbytes,1024,*");
$def[0] .= rrd::line1("bytes","#00ff00 ","Memory");

The CDEF line is the important one, creating a new calculated series called
'bytes' from the one in the RRD.

Now for our horizontal line, assuming the threshold is also in K....

$def[0] .= rrd::hrule($CRIT[0], "#FF0000", "Critical
".(round($CRIT[0]/100000)/10)."GB \\n");

Note how we divide and round to get GB with 1dp.


Steve Shipway
s.shipway at auckland.ac.nz

-----Original Message-----
From: rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch
[mailto:rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On
Behalf Of mmartin
Sent: Tuesday, 22 April 2014 8:57 a.m.
To: rrd-users at lists.oetiker.ch
Subject: Re: [rrd-users] The Y-Axis is Displaying an Incorrect Unit

Ok, so I edited my script that sends the data to RRDTool /(*actually data
goes to PnP4Nagios, which in turn sends to RRDTool)/. I simply added a line
to my script to test sending just 'Bytes' instead of 'Kilobytes' just to see
what would happen, and now the Y-Legend displays with the correct Unit of
'G' for Gigabytes. But, is there anyway to make this happen in RRDTool
instead of changing my script to send Bytes instead of Kilobytes?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5909 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20140421/c0ea4ade/attachment.bin 

More information about the rrd-users mailing list