[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Novell Server Volume manager Stats in PHP

Posted on 2007-07-19
7
Medium Priority
?
339 Views
Last Modified: 2012-06-27
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>
0
Comment
Question by:Zen8Master
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 19541847
Where are you at with the project? what seems to be the problem / where are stuck?
0
 

Author Comment

by:Zen8Master
ID: 19546906
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
0
 
LVL 43

Expert Comment

by:Rob
ID: 19547273
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
0
 

Author Comment

by:Zen8Master
ID: 19571063
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
0
 
LVL 43

Accepted Solution

by:
Rob earned 1000 total points
ID: 19572419
"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..."

I wonder if you can get this connection script to work:

 // Create NWDir UCX object
 $nds = Perl2UCS->new("UCX:NWDir");
 
 // Set tree and context to login
 $nds->{"FullName"} = "nds:\\tree\\context";
 
 // Enter the NDS login name and password
 $nds->login ("username", "password");
 
 // Print short name of current context
 print "Short Name : " . $nds->{"ShortName"} . "\n";
 
 // Logout of NDS tree
 $nds->logout ();
 
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month18 days, 9 hours left to enroll

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question