NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
RRDtool support ?


Joined: 14 Jul 2004
Posts: 4
Location: Stockholm
Reply with quote
Hi,

I am developing a administration interface for a complex statistical application, but lack the ability to try the RRDtool functionality within the IDE itself.

Is there any way to include this module and the functionality it provides, and if so - how?!

http://myserver/~oetiker/webtools/rrdtool/pub/contrib/php4-rrdtool-1.03.tar.gz

Best regards,

-- Hans,

_________________
-- Hans.
View user's profileFind all posts by HansSend private messageMSN MessengerICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
yet, I have no idea how they would work together. Do you have any samples/screenshots/etc ? What kind of "including the functionality" do you mean ? Please elaborate.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Jul 2004
Posts: 4
Location: Stockholm
Reply with quote
ddmitrie wrote:
yet, I have no idea how they would work together. Do you have any samples/screenshots/etc ? What kind of "including the functionality" do you mean ? Please elaborate.


php4-rrdtool-1.03 is a project I worked on a couple of years ago. Use the login and password "demo" to see an example of how it might look.

It's merely just PHP bindings for RRDtool. Contained therein are bindings to allow you to interface php scripts with RRD tool directly via RRD tool's 'librrd' library, thus avoiding the need to use system() calls to the rrdtool binary.

This is a snippet from the INSTALL document in the php4-rrdtool archive, explaining how to install it with PHP4 - my headache comes with any attempts trying to implement it with the IDE:

INSTALL document wrote:
* Installing rrdtool module as a self-contained extension:

There are two ways to install the rrdtool module for php4/zend.
The first involves simply compiling the rrdtool module as a
'self-contained extension'. This is similar to the previous
rrdtool module for php3 in that to use the rrd_* functions you
must first load the module in each script that will use the
rrd_* functions with a dl() call. See the USAGE file for
more info on this.

To install as a self-contained extension:

1. Install rrdtool. (Tested with rrdtool-1.0.33)
Make sure you build shared and static libraries, if
your system lets you.

rrdtool% ./configure --enable-shared

2. Make sure Apache is installed.

3. Make sure PHP4 is installed (tested with php-4.0.6)

4. Now we can build the rrdtool module.

rrdtool-module% ./configure --with-rrdtool=/usr/local/rrdtool \
--with-php-config=/usr/local/bin/php-config

'php-config' is usually installed in /usr/local/bin, and is often
readable/executable only by root, so you will have to run the
configure script as root.

rrdtool-module% make
rrdtool-module% make install

This should build and install 'rrdtool.so' into the correct
directory on your system.

Now you can access the rrd_* functions from your php4 scripts
by first calling " dl("rrdtool.so"); ". See the README and USAGE
for more info on the rrd_* functions.


* Installing the rrdtool module as an embedded extension

Installing rrdtool module as an embedded extension provides all of
your php4 scripts access to the rrd_* functions without having to
load any shared libs with the dl() function of php.

In order to install the rrdtool module as an embedded extension
you will need to have autoconf/automake and friends installed.

1. make sure you have the php4 sources untarred somewhere, lets
call it /src/php-4.0.6/

2. create a home for our embedded extension in the php4 source
tree.

% mkdir /src/php-4.0.6/ext/rrdtool

3. from the rrdtool module directory, do:

% cp config.m4 Makefile.in php_rrdtool.h rrdtool.c \
/src/php-4.0.6/ext/rrdtool/

4. Now we must recreate the configure scripts, etc for php4.

% cd /src/php-4.0.6
% ./buildconf

5. If all goes well, you should be ready to run configure for
php4. Make sure you include "--with-rrdtool" in the options
to configure.

6. make, make install. and you're ready to go.


Just being able to do this snippet of code in the IDE would be most excellent:

Example PHP4 code wrote:

php Header("Content-type: image/gif");


$opts = ....;

$f = tempnam("/tmp","rrd");
$ret = rrd_graph($f, $opts, count($opts));
readfile($f);
unlink($f);


At this moment, I am unable to test any code involving the RRDtool functionality this extension provides, unless I actually upload it to a server that has this module loaded - which kinda partially kills the point of the IDE for my sake. :-/

-- Hans.

PS,
Main site for RRDtool is available at http://www.caida.org/Tools/RRDtool

_________________
-- Hans.
View user's profileFind all posts by HansSend private messageMSN MessengerICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
If I understood you correctly, you can't run RRD stuff on your local machine runnig under Windows and can only test on Unix-alike server only. I see no problem with that, actually. If you can install debugger module on your server you can work with it. IDE offers such things as project publishing, smart synch, remote debugging, etc. Please read FAQ on how to set up project to work with remote Apache.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Jul 2004
Posts: 4
Location: Stockholm
Reply with quote
Thats one option that I have considered, but it makes it hard for me to work on projects while being offline. I travel alot, and spend time coding when travelling - being unable to test the code until I get internet access is a setback, but if there is no way to actually include the extension into the PHP IDE, I guess that there isnt much to do about it. :-/

-- Hans.

_________________
-- Hans.
View user's profileFind all posts by HansSend private messageMSN MessengerICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
PHPED is a client tool while PHP EXTENSION is a server side module. I'm confused a bit Smile)
If you meant you want to use an extension for your development in php, you can do it. PhpED can run locally installed php (what so ever is pointed out in tools->settings->SRV web server) or remotely installed one (what so ever is pointed out in URL project property). Depending on that you can install your very own php extension into appropriate location. Also your success on this way depends on if you have this extension for the OS/platform Smile))
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Jul 2004
Posts: 4
Location: Stockholm
Reply with quote
ddmitrie wrote:
PHPED is a client tool while PHP EXTENSION is a server side module. I'm confused a bit Smile)
If you meant you want to use an extension for your development in php, you can do it. PhpED can run locally installed php (what so ever is pointed out in tools->settings->SRV web server) or remotely installed one (what so ever is pointed out in URL project property). Depending on that you can install your very own php extension into appropriate location. Also your success on this way depends on if you have this extension for the OS/platform Smile))


Ah! Okey, now I am jumping up and down, being happy - but one thing hits me like a brick wall. I dont have any tools what so ever to even attempt to get this extension to work under Windows.

Is this something that you at NuSphere can take care of (URL at the top), and include it for download somewhere? I can imagine that there are several customers besides myself who would be more than happy to have this function..


Best regards,

-- Hans.

_________________
-- Hans.
View user's profileFind all posts by HansSend private messageMSN MessengerICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Well. I took a look at the RRD tool Smile) nice look, indeed.
But from the specs I see that it is available for Unix/Linux systems only. At least I see only that. So, if you need to work with it on your laptop you may install Linux and work with it. To be able to work with phped under Windows you may run Linux under VMWARE from Windows or Windows under VMWARE from Linux. Obviously, the benefits are good enough. You'll run phped under Windows while Apache, php and RRD under their native environment (e.g. Linux). VMWARE will create appropriate bridge between networks and you'll see your Apache running on different IP and hostname Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
RRDtool support ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic