[rrd-users] Re: Weird problem with RRDs::create

Stefan Berder sbe at oleane.net
Tue May 31 15:50:35 MEST 2005


On Tue, 31 May 2005 15:19:01 +0200
Alex van den Bogaerdt <alex at ergens.op.het.net> wrote:
> On Tue, May 31, 2005 at 11:01:20AM +0200, Stefan Berder wrote:
> 
> > I got a weird problem when creating RRD file via a Perl script and I
> > admin I don't really understand the issue.
> 
> Well, if you don't understand the issue, you shouldn't admin :)
> (just kidding)

I meant "admit" ::p

> >     RRDs::create ("report.rrd",
> >                   "--start", $epochstart
> >                   , "--step", 1,
> >                   "DS:avgtime:GAUGE:2:0:U",
> >                   "DS:avgtime2:GAUGE:2:0:U",
> >                   "DS:avgtime3:GAUGE:2:0:U",
> >                   "DS:hit:GAUGE:2:0:U",
> >                   "DS:size:GAUGE:2:0:U",
> >                   "DS:code200:GAUGE:2:0:U",
> >                   "DS:code401:GAUGE:2:0:U",
> >                   "DS:codexxx:GAUGE:2:0:U",
> >                   "RRA:AVERAGE:0.5:1:$rows",
> 
> Looks fine at a first glance.  You're sure the values of the
> variables make it into rrdtool?
> 
> > Where $epochstart is for example 1117524058 (Tue May 31 09:20:58
> > 2005) and rows is calculated by $epochend - $epochstart = 315 as I
> > should have a value each second.
> 
> The first timestamp you can set will be 1117524059. This will define
> the interval from 1117524058 to 1117524059.
> 
> If you want to fill the interval >ending< at 1117524058, you should
> set the start at 1117524058 - stepsize (1117524057 in your case)

In fact my $epochstart is 5 seconds before the start of the real datas
and $epochend is 5 seconds after just to have some extra space.

> > My first problem is that when doing that the rrd file is not
> > starting at $epochstart ...
> > rrdtool info returns : last_update = 1117524151
> 
> Weird.  I can't think of something that would cause this right now.
> Again: are you sure "$epochstart" is 1117524058 and makes it into
> rrdtool ?
> 
> 1117524151-1117524058=93, not a value indicating an obvious mistake.

Here is a full situation of the script :
epochstart: 1117524058
epochend: 1117524373
diff: 315

The error message I get when updating :
RRDs::update error: illegal attempt to update using time 1117524151 when
last update time is 1117524151 (minimum one second step)

And an info dumpo of the rrd :
filename = "200505311544/report.rrd"
rrd_version = "0001"
step = 1
last_update = 1117524151
ds[avgtime].type = "GAUGE"
ds[avgtime].minimal_heartbeat = 2
ds[avgtime].min = 0.0000000000e+00
ds[avgtime].max = NaN
ds[avgtime].last_ds = "UNKN"
ds[avgtime].value = 0.0000000000e+00
ds[avgtime].unknown_sec = 0
ds[avgtime2].type = "GAUGE"
ds[avgtime2].minimal_heartbeat = 2
ds[avgtime2].min = 0.0000000000e+00
ds[avgtime2].max = NaN
ds[avgtime2].last_ds = "UNKN"
ds[avgtime2].value = 0.0000000000e+00
ds[avgtime2].unknown_sec = 0
ds[avgtime3].type = "GAUGE"
ds[avgtime3].minimal_heartbeat = 2
ds[avgtime3].min = 0.0000000000e+00
ds[avgtime3].max = NaN
ds[avgtime3].last_ds = "UNKN"
ds[avgtime3].value = 0.0000000000e+00
ds[avgtime3].unknown_sec = 0
ds[hit].type = "GAUGE"
ds[hit].minimal_heartbeat = 2
ds[hit].min = 0.0000000000e+00
ds[hit].max = NaN
ds[hit].last_ds = "UNKN"
ds[hit].value = 0.0000000000e+00
ds[hit].unknown_sec = 0
ds[size].type = "GAUGE"
ds[size].minimal_heartbeat = 2
ds[size].min = 0.0000000000e+00
ds[size].max = NaN
ds[size].last_ds = "UNKN"
ds[size].value = 0.0000000000e+00
ds[size].unknown_sec = 0
ds[code200].type = "GAUGE"
ds[code200].minimal_heartbeat = 2
ds[code200].min = 0.0000000000e+00
ds[code200].max = NaN
ds[code200].last_ds = "UNKN"
ds[code200].value = 0.0000000000e+00
ds[code200].unknown_sec = 0
ds[code401].type = "GAUGE"
ds[code401].minimal_heartbeat = 2
ds[code401].min = 0.0000000000e+00
ds[code401].max = NaN
ds[code401].last_ds = "UNKN"
ds[code401].value = 0.0000000000e+00
ds[code401].unknown_sec = 0
ds[codexxx].type = "GAUGE"
ds[codexxx].minimal_heartbeat = 2
ds[codexxx].min = 0.0000000000e+00
ds[codexxx].max = NaN
ds[codexxx].last_ds = "UNKN"
ds[codexxx].value = 0.0000000000e+00
ds[codexxx].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 315
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[0].cdp_prep[1].value = NaN
rra[0].cdp_prep[1].unknown_datapoints = 0
rra[0].cdp_prep[2].value = NaN
rra[0].cdp_prep[2].unknown_datapoints = 0
rra[0].cdp_prep[3].value = NaN
rra[0].cdp_prep[3].unknown_datapoints = 0
rra[0].cdp_prep[4].value = NaN
rra[0].cdp_prep[4].unknown_datapoints = 0
rra[0].cdp_prep[5].value = NaN
rra[0].cdp_prep[5].unknown_datapoints = 0
rra[0].cdp_prep[6].value = NaN
rra[0].cdp_prep[6].unknown_datapoints = 0
rra[0].cdp_prep[7].value = NaN
rra[0].cdp_prep[7].unknown_datapoints = 0

> > when I try the command directly from commandline the result is
> > different: 
> > $ rrdtool create report.rrd --start 1117524058 --step 1
> > DS:avgtime:GAUGE:2:0:U DS:avgtime2:GAUGE:2:0:U
> > DS:avgtime3:GAUGE:2:0:U DS:hit:GAUGE:2:0:U DS:size:GAUGE:2:0:U
> > DS:code200:GAUGE:2:0:U DS:code401:GAUGE:2:0:U DS:codexxx:GAUGE:2:0:U
> > RRA:AVERAGE:0.5:1:315 $ rrdtool info report.rrd | grep last_update
> > last_update = 1117524058
> > 
> > Now it's taking my start date as the last date I could set ... which
> > is obviously what I'm not trying to get.
> 
> No.  "last_update" is the last update that occured.  All intervals
> upto 1117524058 are defined, you can fill the next slot.

Ok got that one, as I got different values between perl and commandline
I didn't understood well.

> I think I've given you some information you can use.  Was it enough?

Seems not ::)

Moreover, it's running on a debian sarge with :
$ rrdtool -v
RRDtool 1.0.49  Copyright 1997-2004 by Tobias Oetiker <tobi at oetiker.ch>

Usage: rrdtool [options] command command_options

Valid commands: create, update, graph, dump, restore,
                last, info, fetch, tune, resize, xport

RRDtool is distributed under the Terms of the GNU General
Public License Version 2. (www.gnu.org/copyleft/gpl.html)

For more information read the RRD manpages

Stefan
ps: Attach is the full debug of my perl script with the update commands
-- 
 #=- Stefan Berder                  tel : 6 14 80        -=#
 #=- Ingénieur système et réseau          01 53 95 14 80 -=#
 #=- TRANSPAC / DO-DAE-ADMP-iSO    mail : sbe at oleane.net -=#
 #=- /(bb|[^b]{2})/      stefan.berder at francetelecom.com -=#

-- Attached file removed by Ecartis and put at URL below --
-- Type: application/octet-stream
-- Size: 7k (7227 bytes)
-- URL : http://lists.ee.ethz.ch/p/full_debug.log


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