[rrd-users] Re: How do I get the current time in the graph

Tobias Oetiker oetiker at ee.ethz.ch
Wed Aug 24 20:25:40 MEST 2005


Today Rob Tanner wrote:

> Hi,
>
> I would like to put a timestamp in the graph so we know at what time the
> graph was created.  I have looked through the docs and tried to play
> with the TIME and LTIME rpn values, but have not been successful at
> setting a variable with the value of the current time.  Does anyone have
> an example of of setting a variable with the time of day?

this is normally done externally by executing some command that
returns the time in a sensible format and then you just add this to
a graph using the COMMENT command ... note that you have to
backslash escape all instances of : in the time string ...

in perl you could do:

my $date = localtime(time);
$date =~ s/:/\\:/g;
......
COMMENT:$date

cheers
tobi

> Thanks.
>
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETL F24.2, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/oetiker +41(0)44-632-5286

--
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