[rrd-users] Re: php bindings for rrdtool

Nate nate at seekio.com
Mon Nov 13 17:29:25 MET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Here is the RRD.inc class I wrote for one of my PHP projects.  It spawns
the RRD process on instantiation, and keeps it open till descruction.
I've been using it for years with a very heavy load app with no
problems.  It's written for PHP4, so some modifications might be needed
for PHP5, specifically with the destructor.  But if you code your app
right, it will let you run multiple commands with one rrd fork exec.
Just make sure you don't prematurely destruct the object.

include('RRD.inc');
$rrd = new RRD;
$ret = $rrd->cmd('a_valid_rrd_command');
$ret = $rrd->graph('a_valid_rrd_graph_command');

graph() just calls cmd(), but it will parse out the image info from the
return value and return a <img/> tag.  cmd() returns the output from the
rrd process.

You can get it from http://os.cyberheatinc.com/RRD.inc.phps.  Feel free
to modify it to your liking, it's GPL.

Nate

Maarten Claes wrote:
> Hi List,
>  
> 
> I'm having trouble finding out how I can integrate rrdtool in one of my
> php projects (mostly graphing). I looked at
> http://rpmfind.net/linux/rpm2html/search.php?query=rrdtool-php but my
> operating system is not on there (centos 4.3, apache2 + PHP5).
> 
>  
> 
> At the moment, I have compiled rrdtool with perl support but I'd like to
> know if there are options to add PHP support in the compilation process.
> 
> 
>  
> 
> Can anyone point out how I should proceed from here on ?
> 
>  
> 
> Thanks a lot!
> 
>  
> 
> Maarten.
> 
>  
> 
>  
> 
> 
> --
> 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://lists.ee.ethz.ch/rrd-users
> WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFWJ1jRMRYK1K/wKQRAvGmAKCQ/ttiIoZnuHC6ZKZsrmMGmZt+cACfUeN9
RS7Cts6GRARUlQ742Sj94gI=
=Tf27
-----END PGP SIGNATURE-----


-- Attached file removed by Ecartis and put at URL below --
-- Type: application/x-pkcs7-signature
-- Desc: S/MIME Cryptographic Signature
-- Size: 3k (3491 bytes)
-- URL : http://lists.ee.ethz.ch/p/10-smime.p7s


--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list