[rrd-users] rrd_create() failed!

Ambles Kock ambles at inktomi.com
Fri Nov 2 08:17:16 MET 2001


All,

Would you please shed some lights...

I have using a simple C program that loops and creates a bunch of RRD files using the rrd_create() function call in rrdlib.a. However, as the program loops, only the first RRD file is created; all other RRD files are not created. I further deduced the problem with only 2 RRD files. Please see the code segment below.

 char a1[] = "create ./1.rrd -b N -s 300 DS:ds:GAUGE:6000:0:10000 RRA:AVERAGE:0.5:1:288";
 char a2[] = "create ./2.rrd -b N -s 300 DS:ds:GAUGE:6000:0:10000 RRA:AVERAGE:0.5:1:288";

 argc = CountArgs(a1);
 myargv = (char **) malloc((argc+1) * sizeof(char *));
 bzero(myargv, (argc+1) * sizeof(char *));
 argc = CreateArgs("blah", a1, argc, myargv);
 rrd_create((argc-1), &myargv[1]);
  
 argc = CountArgs(a2);
myargv = (char **) malloc((argc+1) * sizeof(char *));
bzero(myargv, (argc+1) * sizeof(char *));
argc = CreateArgs("blah", a2, argc, myargv1);
rrd_create((argc-1), &myargv1[1]);

[ the functions CountArgs() and CreateArgs() are copied from rrd_tool.c ]

In the above example, only 1.rrd is created; 2.rrd is not created, but instead a file named "300" is created. I can't solve this puzzle, has anyone experienced it? Am I missing something here? 

Many many thanks in advance!

- awk

--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list