[rrd-users] Re: rrdtool update & adding historical data

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Oct 20 23:43:32 MEST 2004


On Wed, Oct 20, 2004 at 04:27:18PM -0400, Mike.Fountain at worldspan.com wrote:

> rrdtool update preprod.rrd -60:56:96:0:0:0:96:0:0:0:0:0:0 - ERROR: unknown
> option 'preprod.rrd'
> rrdtool update preprod.rrd N:56:156:0:0:0:156:0:0:0:0:0:0

seems the option parser gets it wrong :(

> It wasn't completely clear from the "rrdtool update" man page whether or
> not I could use a negative time value.
> This is what the man page said:
>                                                                             
>        This time can either be defined in seconds since 1970-01-01. Or by   
>        using the letter 'N' the update time is set to be the current time.  
>        Negative time values are subtracted from the current time.           
> 
> So, should I be able to use -60 to indicate a sample from 60 seconds ago?

I'd read the same in that page, yes.

> Or do I need to do use the seconds since 1970 timestamp?

Perhaps that's better, just in case.

> And, if I need to use the seconds from 1970 stamp, what is an easy way to
> calculate that in perl?

"time()" results in "now", so "time()-60" results in what you want.

perl -e 'print time()-60 . "\n"'

But if you're going to delay updates, why not save the real timestamp at
the moment you collect it, and use that?

rrdtool update $your.rrd $timestamp1:$data1  $timestamp2:$data2 ...

HTH
Alex
-- 
You want an answer?  You'd better follow the following guidelines!
Linesize well below 80 chars. Reply to the list, not to me. Trim
irrelevant lines. Reply _below_ the relevant lines, not on top.

--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list