[rrd-users] newbie question: C(++) integration with rrd

Mr Dash Four mr.dash.four at googlemail.com
Sun Sep 30 14:28:31 CEST 2012

> I'd be a bit wary of trying to store event-based data in an RRD.  RRD files need to have values stored on a regular interval, and will normalise the data (or invalidate it) if it doesnt come in when expected.  So, as long as your RRD is configured with (eg) a 1min interval, and you collect and store your (eg) system temperature every 1 minte, then you should be OK.  You can't only record the data when there is an 'event' (unless they happen at a predetermined regular frequency!)
Interesting! I used to do this, but in a "convoluted" sort of way - 
running a shell script (via crontab) which checks various logs for 
"hits" (i.e. when a packet is bounced by netfilter for example) and then 
logs them to RRD. Although the "hits" produced are obviously not 
happening regularly, the script checking these is. Out of interest, what 
would happen if I do run and log data at irregular intervals to RRD?

> If you're fully aware of that, then the librrd.a and rrdtool header files should work for you.  The C api is surprisingly similar to the other APIs and the command-line usage, so it shouldnt be too hard.
> I don't know of any tutorials or references specifically on the C API, though I've been working on creating one off and on over the last year...
Thanks, I'll have a more thorough look when time permits.

More information about the rrd-users mailing list