[rrd-users] Automatic Timestamp in RRD graphs

Simon Hobson linux at thehobsons.co.uk
Wed Nov 26 16:12:27 CET 2008


Martin Knoblauch wrote:

>  is there an rrdtool option to add a time stamp to the RRD graphs? 
>That would be good for docimantation purposes. One can of course add 
>them manually, but I am lazy :-)

I would recommend that you calculate the end time explicitly, rather 
than use 'now'. Eg :

Now=`date +%s`
End=$(( $Now - $Now % $Step ))

Then you can use $End in your script, probably by using date to 
format it for you.

Why do this ?

Well for documentation reasons, it gives the end date of the actual 
data that is graphed - eg :15:10 instead of 15:11:27.

And of course, it avoids problems where rrd tool decides that a lower 
resolution RRA covers your requested timespan better than the hi res 
RRA you expected it to use.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the rrd-users mailing list