[rrd-developers] problems with rrd_update() when updating rrd file

Tomáš Macek maca02 at atlas.cz
Thu May 20 12:28:25 CEST 2010


Hi, I have RHEL 5.5 with rrdtool 1.4.3 and I'm using it's API for updating  
rrd files. The problem is that when I pass arguments to the rrd_update()  
function, it always returns error saying "Usage: rrdtool update [--daemon  
<addr>] <file>". The same code worked really fine on 1.3.8. I looked at  
the CHANGELOG file and there was some line saying, that something has  
changed on checking optarg parameters.

This is from gdb just before I pass the array into rrd_update() function:
-----------
Breakpoint 2, rrd_cmd (rrdcmd=0x634dc0 "update", cmd=1, di_cnt=2) at  
rrd_op.c:215
215                 error = rrd_update(i, argv);
(gdb) p argv
$26 = {0x634dc0 "update", 0x634dc7 "cac_ap2aeth.rrd",
   0x634e06 "--template", 0x634e11 "ds0:ds1", 0x634e19  
"N:2325779922:3582706806", 0x0 <repeats 59 times>}
-----------

and after program goes thourgh rrd_update(), the argv array looks like  
this:
-----------
216                 if (error == -1) {
(gdb) p argv
$28 = {0x634dc0 "update", 0x634e06 "--template", 0x634e11 "ds0:ds1",
   0x634dc7 "cac_ap2aeth.rrd", 0x634e19 "N:2325779922:3582706806",
   0x0 <repeats 59 times>}
-----------

Please, notice the replaced arguments after rrd_update()... I don't know,  
what I'm doing wrong, the code under 1.3.8 library worked just fine and  
according to the man rrdupdate the arguments are fine. Hope I'm not  
missing something stupid, but I was not able to find anything strange in  
rrd_update() function in the rrd_update.c.
Let me know, if you need something more from me, thank you

Regards, Tomas



More information about the rrd-developers mailing list