[rrd-developers] Re: Developing against librrd
domi at dcs.net
domi at dcs.net
Thu Jan 23 00:03:51 MET 2003
Hi David, Hi List !!!
Try ripping off the "
You can also skip the first argument "./rrdpoll"
because rrdtool do not need it (that's the reason
why the args are passed &args[1]).
This is how I did and it works perfect !!!
char *args[5];
args[0] = "fetch";
args[1] = db;
args[2] = "MAX";
args[3] = str_start;
args[4] = str_end;
rrd_fetch(5, args, &stime, &etime, &step, &rscount, &sources, &data);
=d0Mi=
> ---- Original Message -----
> Date: 22-Jan-2003 22:00:41 +0100
> From: David Olsen <lude at linuxpimpz.com>
> To: <rrd-developers at list.ee.ethz.ch>
> Subject: [rrd-developers] Developing against librrd
>
> Hey all,
>
> I'm trying to write a snmp poller in C that will use RRD as its data storage
format, however I've run into nothing but troubles.
>
> If i "fake" and argv[] style array to pass to rrd_create, like so:
> char *args[]={ "./rrdpoll",
> "create> "test2.rrd> "--start=1043194325> "DS:ifInOctets:COUNTER:600:U:U> "DS:ifOutOctets:COUNTER:600:U:U> "DS:ifInUcastPkts:COUNTER:600:U:U> "DS:ifOutUcastPkts:COUNTER:600:U:U> "DS:ifInErrors:COUNTER:600:U:U> "RRA:AVERAGE:0.5:1:600> "RRA:AVERAGE:0.5:6:700> "RRA:AVERAGE:0.5:24:775> "RRA:AVERAGE:0.5:288:797> "RRA:MAX:0.5:1:600> "RRA:MAX:0.5:6:700> "RRA:MAX:0.5:24:775> "RRA:MAX:0.5:288:797> 0 };
>
> and call it like this:
>
> printf("Making test2.rrd: %dn", rrd_create(16,&args[1]));
>
> I get a bus error backtracing like so:
> (gdb) bt
> #0 0x2826dcc0 in strtok_r () from /usr/lib/libc_r.so.4
> #1 0x2826dd0d in strtok () from /usr/lib/libc_r.so.4
> #2 0x281c4893 in rrd_create (argc=16, argv=0xbfbffa2c) at
rrd_create.c:182
> #3 0x80495f0 in createrrd (argv=0xbfbffb74) at rrdpoll.c:179
> #4 0x80494b8 in main (argc=14, argv=0xbfbffb74) at rrdpoll.c:32
> #5 0x8048b5a in _start ()
>
> Anyone have any suggestions?
>
> Best Regards,
>
> David Olsen
> ISPrime, Inc.
> 866.502.4678 ext. 87
> AIM: Dave ISPrime - ICQ: 136633378
>
> --
> 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