[rrd-users] Re: C calls in rrdtool

Iain Buchanan iain at pcorp.com.au
Tue Sep 10 03:27:22 MEST 2002


On Tue, 2002-09-10 at 06:49, Tobias Oetiker wrote:
> Today tome anticic wrote:
> > Hi,
> >
> > I probably have a rather naive question concerning rrdtool. I know it
> > is possible to have rrdtool commands as system commands or as perl
> > calls.
> >
> > But is it possible to have rrdtool commands from a C program?
> > I am developing a C (actually C++) monitoring program, and each time an
> > rrdtool call is made I use the  system("rrdtool update ...") calls.
> >
> > These system calls seem to me a waste of CPU, as I have to make hundreds
> > of them every few seconds. Is it possble to link
> > rrdtool libraries to have in my C program something like
> > rrdtool_update(...) or rrdtool_fetch?
> >
> 
> Sure you can call it from C ... look at rrd_cgi ...
> make sure to reset error variables and getopt externals between
> calls .. use rrd_cgi.c as sample
> tobi
> >
> > 	Tome
Or you could open a 2 way pipe to rrd, and read and write to / from it
that way.  I've used this method very successfully in perl, so I imagine
it would work ok in C too.

Iain


-- Attached file removed by Listar and put at URL below --
-- Type: application/pgp-signature
-- Desc: This is a digitally signed message part
-- Size: 233 bytes
-- URL : http://www.ee.ethz.ch/~slist/pantomime/11-signature.asc


--
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