Re: rrd_update_r() error : expected timestamp not found in data source from update

[email protected] (Tony Mountifield) Mon, 21 Dec 2015 13:14:01 +0000 (UTC)
Newsgroups gmane.comp.db.rrdtool.user
Organization Software Insight Ltd., Winchester, UK
Message-ID <[email protected]>
In article <[email protected]>,
Tony Mountifield <[email protected]> wrote:
> In article <CADgchnuMGkA=tQdMtACMWPYX2TgDUwKfbf3g=d+Fa3V5BP+WDA@mail.gmail.com>,
> Athanasios Silis <[email protected]> wrote:
> > Hello there,
> > I am trying to use rrd_update_r() to update a rrdb through a c++ program.
> > So I am generating the argc/argv on the fly to pass into the function.
> > 
> > The originating string is the following:
> > 
> >         time_t tm = time(NULL);
> >         stringstream ss;
> >         ss << tm;
> >         string updstr = string("update sensors.rrd \
> >                 --template CO2unf:CO2fil:O2pp:O2pct:O2temp:O2pres ")\
> >                 + ss.str() + string(":1015:1000:123:20.63:38.48:987");
> > 
> > I get this error  from rrd_get_error():
> > sensors.rrd: expected timestamp not found in data source from update
> > 
> > Is timestamp not accepted in seconds from EPOCH?
> 
> Can you show your code all the way from the above until the call to rrd_update_r()?
> 
> Also, show the value of updstr, to make sure it is what you think it is?

I got your private email, to which I'll respond, but other people may be
interested in answers, so it's better to continue here.

Have a look at http://stackoverflow.com/questions/6681090/how-to-call-threadsafe-rrd-update-r-round-robin-database-function-with-c-api

In particular, I think you need to give rrd_update_r() the template separately,
rather than as a --template argument.

Cheesr
Tony
-- 
Tony Mountifield
Work: [email protected] - http://www.softins.co.uk
Play: [email protected] - http://tony.mountifield.org