[rrd-developers] Re: rrd_create() failed!

Ambles Kock ambles at inktomi.com
Sat Nov 3 00:19:36 MET 2001


Ashok and all,

Thanks for the response, but that's not the problem. I edited the code as I
posted the news. Please replace myargv1 with myargv.

Ambles
----- Original Message -----
From: "Ashok Mandala" <amandala at routescience.com>
To: "Ambles Kock" <ambles at inktomi.com>
Cc: <rrd-users at list.ee.ethz.ch>; <rrd-developers at list.ee.ethz.ch>
Sent: Thursday, November 01, 2001 7:18 AM
Subject: Re: [rrd-developers] rrd_create() failed!


> >> argc = CreateArgs("blah", a2, argc, myargv1);
>
> What is myargv1 initialized to - Maybe the bug lies there.
>
> Ashok.
>
> Ambles Kock wrote:
>
> > 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-developers-request at list.ee.ethz.ch?subject=unsubscribe
> > Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
> > Archive     http://www.ee.ethz.ch/~slist/rrd-developers
> > WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>


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



More information about the rrd-developers mailing list