[mrtg-developers] [rrd-developers] Making MRTG work with rrdcached

Steve Shipway s.shipway at auckland.ac.nz
Wed Sep 15 06:58:28 CEST 2010


> Steve said
> > Is anyone currently working on making MRTG 2.16.x work correctly with
> > rrdcached (RRDTool 1.4.x)?

Tobi said
> sounds interesting ... there are ideas on how to make updatev work
> in rrdcached mode. It would require more of the functionality of
> rrdtool to happen in memory before flushing data to disk. This
> should be possible but it would require some rather involved heart
> surgery.

I couldn't wait, and started hacking :)

I've submitted a small patch for MRTG that makes it rrdcached-aware, although for now it simply disables threshold checking and uses update rather than updatev.

I've been hacking rrd_daemon.c to make it support INFO and LAST (done!) and I'm looking at making it support create.  For INFO and LAST, I've used the time on the rrd file itself rather than in the queue, since any calls to GRAPH and FETCH will bypass the cache anyway.  This also makes it much easier :).  For CREATE, there's a bit more of an issue since we probably want to prevent absolute pathnames; however, noone would be stupid enough to run their rrdcached as root now, would they...?  Maybe I should reject absolute paths if UID==0?

Once these are done, I need to sort out the main functions to use rrdcached for these three, and finally get MRTG to recognise the features and use them.

I've been shying away from the updatev function since, as Tobi says, it requires rather deep work to query the values still in the cache queue.  For INFO and LAST, and possibly even GRAPH and FETCH, you could get away with ignoring the cache queue and just reading from the RRD file (call a FLUSH before your graph/fetch if it bothers you) but you can't really do this with updatev.

I wonder if the rrdgraph command could be supported by returning the graph image as a huge base64-encoded blob?  It would need to force a flush beforehand... (goes off to think)

Steve

Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 924 6487
Mobile: +64 (0)21 753 189
Email: s.shipway at auckland.ac.nz
 Please consider the environment before printing this e-mail 





More information about the mrtg-developers mailing list