[rrd-users] C API problem (rrd_update)
Dustin Sallings
dustin+rrdtool at spy.net
Wed Jan 23 06:41:58 MET 2002
I've got an application that receives temperature data from
various parts of my network via multicast and I'd like to store this into
rrd. I stumbled across the C API, and it looks easy enough, so I figured
I'd give it a go.
If I understand it correctly, I feed the same thing I'd feed into
``rrdtool -'' and it should just go, however, it's reporting an error
on each update after the first:
update file.rrd -t 10C8892A00000096 1011763371:20.940001
OK
update file.rrd -t 10E8C214000000E4 1011763404:14.180000
ERROR: opening '10E8C214000000E4': No such file or directory
args[0]=``update''
args[1]=``file.rrd''
args[2]=``-t''
args[3]=``10E8C214000000E4''
args[4]=``1011763404:14.180000''
update file.rrd -t 1081841E000000DF 1011763405:17.030001
ERROR: opening '1081841E000000DF': No such file or directory
args[0]=``update''
args[1]=``file.rrd''
args[2]=``-t''
args[3]=``1081841E000000DF''
args[4]=``1011763405:17.030001''
[etc...]
If I have it just output the command and feed it into rrdtool -,
it works just fine (well, it doesn't like there being more than one update
per second when it happens, but that's a fairly easy problem to deal with
once I get to it).
It seems to be handling the commandline incorrectly after the
first call.
Here's the calling code (buf is the command that's being printed
out):
args=split(buf, " ");
rv=rrd_update(listLength(args), args);
if(rv<0 || rrd_test_error()) {
int i=0;
printf("ERROR: %s\n", rrd_get_error());
for(i=0; i<listLength(args); i++) {
printf("\targs[%d]=``%s''\n", i, args[i]);
}
rrd_clear_error();
} else {
printf("OK\n");
}
--
SPY My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin at spy.net>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________
--
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