Link to home
Start Free TrialLog in
Avatar of Zen8Master
Zen8MasterFlag for United States of America

asked on

Novell Server Volume manager Stats in PHP

Basics, Novell 6.5 apache tomcat PHP 5

I Want to create an php page that connects to 35 servers polls server and volumes for drivespace writes to a display page and writes to a mysql database to update server info (database already exists)

this will run on a single server and create html page, one page for all 35 servers would be nice but a multi framed page opening up the php from all 35 servers was one way I can see the info

<html>

<head>
<title>Server Statistics</title>
</head>

<body>

<h1>Aegrgpitd1</h1>

<?php // Create an HTML table based on the values from the db ?>
<table border><TD>
<tr><B><th>Volume Name</th><th>Total Space</th><th>Free Space</th></tr>


<?php

$vol = new UCS('UCX:volumemgr') or die("<font color=red><b>Unable to create the Volume Manager object</b></font><br>");

$db = $vol->{"Volumes"};
$retVal1 = $db->reset();
$retVal1 = $db->hasMoreElements();

while ($retVal1)
{
    $retVal2 = $db->Next();
    $retVal3 = $retVal2->{"Name"};
    $tb      = $retVal2->{"TotalSpace"};
    $fb      = $retVal2->{"FreeSpace"};
?>
    <tr>
    <td>
   <?php echo $retVal3; ?>
   </td>
    <td>
   <?php echo $tb; ?>
   </td>
    <td>
   <?php echo $fb; ?>
   </td>
    <td>
    </tr>
    <?php
   $retVal1 = $db->hasMoreElements();
}

?>

</table>
Avatar of Rob
Rob
Flag of Australia image

Where are you at with the project? what seems to be the problem / where are stuck?
Avatar of Zen8Master

ASKER

I would like to view as a html summary page and send all data for all servers to a mysql server database to allow me to set up trending stats.
this works fine and kicks back stats on the server it is on but I would like to run against all my servers from one server
The first thing that comes to mind with this is setup a SOAP interface on each of your servers that when called will return the stats that you want in an xml structure:

for example:

a SOAP request may just call a common function that does what you've detailed in your code above and returns the data to the calling page

So the following is running on one server gathering the information.  It is asking each server for the stats using the following code

(note: this is just conceptual and doesn't document any real functions just for design purposes)

$server1 = SOAP_REQUEST('http://10.0.100.1/stats.php');
$server2 = SOAP_REQUEST('http://10.0.100.2/stats.php');
$server3 = SOAP_REQUEST('http://10.0.100.3/stats.php');

you can then enter this into a database quite easily but lets work out this first
HMMMM...SOUNDS INTERESTING...
I am just a newbie though..goot at putting other thing together from other sources...(not yet good enough to be creative yet,  except on a small scale)
It seems SOAP is supported on novell apache 2/tomcat I can not find any clear cut examples to use or copy...
What I have done so far is to put a link field in my database to run the vstats.php in a child window from the server in question and write to the other fields (free space ect.) when the vstats.php is run...
it would be nice to run from one place...
I can not seem to find any way to call the
"$vol = new UCS('UCX:volumemgr')" from another server than the one it is on...
thanks
Rob
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial