[rrd-users] Re: rrdupdate - not a simple integer

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Sep 13 17:00:24 MEST 2005


On Tue, Sep 13, 2005 at 02:11:10PM +0100, Edmonds, Alan wrote:

> I started seeing this error after upgrading from RRDtool 1.0.x to 1.2.

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

Somewhere on september 2nd 2003, a check was implemented.  It checks for
the input to be a digit or a minus sign.  Indeed, this means you can enter
integers only.

> It seems rrdtool should allow non-integers for updates to COUNTER and DERIVE types.

A quick workaround:  remove some lines and recompile. (untested !)

--- rrd_update.c        2005-09-13 16:57:58.000000000 +0200
+++ rrd_update_nocheck.c        2005-09-13 16:58:36.000000000 +0200
@@ -629,15 +629,6 @@
                case DST_COUNTER:
                case DST_DERIVE:
                    if(rrd.pdp_prep[i].last_ds[0] != 'U'){
-                      for(ii=0;updvals[i+1][ii] != '\0';ii++){
-                            if(updvals[i+1][ii] < '0' || updvals[i+1][ii] > '9' || (ii==0 && updvals[i+1][ii] == '-')){
-                                 rrd_set_error("not a simple integer: '%s'",updvals[i+1]);
-                                 break;
-                            }
-                       }
-                       if (rrd_test_error()){
-                            break;
-                       }
                       pdp_new[i]= rrd_diff(updvals[i+1],rrd.pdp_prep[i].last_ds);
                       if(dst_idx == DST_COUNTER) {
                          /* simple overflow catcher suggested by Andres Kroonmaa */

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