[rrd-developers] Suggestion for API extension
Benny Baumann
BenBE at geshi.org
Thu Jul 30 16:38:16 CEST 2009
Hi,
Am 30.07.2009 15:18, schrieb Dan Cech:
> Hi Benny,
>
> Benny Baumann wrote:
>
>> I recently discovered the PHP extension for RRDTool which is available
>> as a contribution to RRDTool. This extension runs successfully with
>> latest PHP5, but misses some functions of current RRDTool releases (no
>> rrd_dump, no rrd_info). I'm currently working on updating the PHP
>> extension to also include these operations.
>>
>
> Funny, I've been doing some work on the PHP rrdtool extension myself in
> the last couple of weeks. It's not quite ready for prime-time yet, but
> I have completed the following:
>
> - remove requirement to send argument count to rrd_graph
> - remove requirement to send argument count to rrd_fetch
>
Sounds good.
> - add support for rrd_xport
>
That is really good ;-)
> - support multiple update values in rrd_update
>
Will need to have a look at this, but in general this sounds positive ;-)
> - support rrd_lastupdate
> - support rrd_first
>
Great ;-)
> - clean up phpinfo() output
>
Yep. That one was really messy :P
Though rrdtool_info will need some cleanup too. Simply returning an
array will all the needed values should be sufficiant and much more
practical.
> I was planning to tackle rrd_info next, but haven't looked at rrd_dump.
>
I already completed rrd_info, but didn't parse the returned key names.
I'm writing a PHP wrapper for this PHP extension and as such I can do
parsing of the keynames there.
Some work on Open Basedir Restriction can be found at
http://blog.benny-baumann.de/?p=352 (German). The patch there isn't
fully up-to-date, bbut basically works (except for one minor typo I
already fixed in my local dev version).
Would be nice if we could exchange our versions to merge the changes,
thus avoiding duplicate work.
One problem (I mentioned in my blog) I couldn't solve yet is enforcing
the OpenBasedir Restriction for filenames mentioned in the command line
arguments (e.g. for rrd_graph. IDK if you've got a solution.
But well, back to the API extension suggested here:
What do you think of offering a callback based variant in addition to a
file based variant thus programs that need the returned data in a buffer
can grab it without needing to write to the filesystem?
Other functions (e.g. for rrd_graph) that write to disk might use such a
callback too, or offer returning the ressources they created to the
caller (i.e. giving the generated image as a internal ressource to the
caller).
Regards,
BenBE.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20090730/9876c2e1/attachment.bin
More information about the rrd-developers
mailing list