[rrd-developers] Re: rrdupdate error - Not a simple integer

Tobias Oetiker oetiker at ee.ethz.ch
Wed Nov 2 12:44:57 MET 2005


Hi Alan,

the problem is that rrdtool handles updates to DERIVE and COUNTER
by building the difference of two long long long long integers so
it this was changed to double then your request would be possible
... except that in this case we would be loosing precision at the
low end if you feed the system with counters that are at their max
which might be rather undesirable ...

cheers
tobi



>
> I started seeing this error after upgrading from RRDtool 1.0.x to 1.2.
>
> Perhaps I'm missing something with rrdtool.  I'm using rrdtool fronted
> by Cricket 1.0.5 (http://cricket.sourceforge.net/).
>
> Quite simply, it appears you cannot use non-integers with rrdupdate with
> DERIVE and COUNTER types.  If a COUNTER is bits per second or units, it makes
> sense that it would only be an integer.  But if it's something like megabits
> per second or other non-integer values, it doesn't allow it.
>
> I threw together a test script. It's the example from the rrdtutuorial man page
> with the data values changed to floating point numbers.
>
> 	echo test 1 - GAUGE type
>
> 	rm -f test-gauge.rrd
>
> 	rrdtool create test-gauge.rrd  --start 920804400 DS:speed:GAUGE:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
> 	rrdtool update test-gauge.rrd 920804700:1.2345 920805000:1.2357 920805300:1.2363
>       rrdtool update test-gauge.rrd 920805600:1.2363 920805900:1.2363 920806200:1.2373
>       rrdtool update test-gauge.rrd 920806500:1.2383 920806800:1.2393 920807100:1.2399
>       rrdtool update test-gauge.rrd 920807400:1.2405 920807700:1.2411 920808000:1.2415
>       rrdtool update test-gauge.rrd 920808300:1.2420 920808600:1.2422 920808900:1.2423
>
> 	echo test 2 - COUNTER type
>
> 	rm -f test-counter.rrd
>
> 	rrdtool create test-counter.rrd  --start 920804400 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
>
> 	rrdtool update test-counter.rrd 920804700:1.2345 920805000:1.2357 920805300:1.2363
>       rrdtool update test-counter.rrd 920805600:1.2363 920805900:1.2363 920806200:1.2373
>       rrdtool update test-counter.rrd 920806500:1.2383 920806800:1.2393 920807100:1.2399
>       rrdtool update test-counter.rrd 920807400:1.2405 920807700:1.2411 920808000:1.2415
>       rrdtool update test-counter.rrd 920808300:1.2420 920808600:1.2422 920808900:1.2423
>
> 	echo test 3 - DERIVE type
>
> 	rm -f test-derive.rrd
>
> 	rrdtool create test-derive.rrd  --start 920804400 DS:speed:DERIVE:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
>
> 	rrdtool update test-derive.rrd 920804700:1.2345 920805000:1.2357 920805300:1.2363
>       rrdtool update test-derive.rrd 920805600:1.2363 920805900:1.2363 920806200:1.2373
>       rrdtool update test-derive.rrd 920806500:1.2383 920806800:1.2393 920807100:1.2399
>       rrdtool update test-derive.rrd 920807400:1.2405 920807700:1.2411 920808000:1.2415
>       rrdtool update test-derive.rrd 920808300:1.2420 920808600:1.2422 920808900:1.2423
>
>
> The first test (GAUGE type) works fine.  But the COUNTER and DERIVE tests all generate errors:
>
> ERROR: not a simple integer: '1.2357'
> ERROR: not a simple integer: '1.2363'
> ERROR: not a simple integer: '1.2393'
> ERROR: not a simple integer: '1.2411'
> ERROR: not a simple integer: '1.2422'
>
> ERROR: not a simple integer: '1.2357'
> ERROR: not a simple integer: '1.2363'
> ERROR: not a simple integer: '1.2393'
> ERROR: not a simple integer: '1.2411'
> ERROR: not a simple integer: '1.2422'
>
> It seems rrdtool should allow non-integers for updates to COUNTER and DERIVE types.
>
> I'm using rrdtool 1.2.11 on FreeBSD 4.11 and 5.4.
>
> RRDtool 1.2.11  Copyright 1997-2005 by Tobias Oetiker <tobi{at}oetiker{dot}ch>
>                Compiled Wed Aug 24 16:27:34 BST 2005
>
> Usage: rrdtool [options] command command_options
>
> Valid commands: create, update, updatev, graph, dump, restore,
>   last, first, 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
>
> I posted this to rrd-users and it was suggested to send this to -developers.
>
> Can someone justify the code only allowing integers with rrdupdate?  Or just
> remove the sanity check on the input values from rrdupdate.c?
>
> Thank you,
>

-- 
 ______    __   _
/_  __/_  / /  (_) 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-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-developers mailing list