The PECL/rrd extension provides bindings to the RRDtool C library.