Moved some files into subdirs, and deleted unused images
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@69 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
@ -6,7 +6,6 @@ $TOPDIR = '.';
|
||||
$expire_time = gmmktime(0, 0, 0, 1, 1, 2038);
|
||||
setcookie("history", "date;hello.sh", $expire_time);
|
||||
|
||||
//require_once("globalconfig.php");
|
||||
require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
|
||||
require_once "$TOPDIR/functions.php";
|
||||
|
@ -21,8 +21,7 @@ $expire_time = gmmktime(0, 0, 0, 1, 1, 2038);
|
||||
|
||||
<FORM>
|
||||
<?php
|
||||
require_once("globalconfig.php");
|
||||
require_once("XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
|
||||
require_once "$TOPDIR/functions.php";
|
||||
|
||||
|
Before Width: | Height: | Size: 61 B |
Before Width: | Height: | Size: 379 B |
Before Width: | Height: | Size: 50 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 800 B |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 170 B |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 71 B |
Before Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 990 B |
Before Width: | Height: | Size: 47 B |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1009 B |
Before Width: | Height: | Size: 123 B |
Before Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB |
@ -1,157 +0,0 @@
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
color:#666666;
|
||||
font-family:Arial,Helv,sans-serif;
|
||||
font-size:11px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
a:link,a:visited {
|
||||
color: #FFF;
|
||||
font-weight:
|
||||
bold; text-decoration:none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #fff;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.content_title {
|
||||
position: absolute;
|
||||
padding-top: 18px;
|
||||
padding-left: 17px;
|
||||
font-size:14px;
|
||||
margin-bottom: 1px;
|
||||
font-weight:bold;
|
||||
width: 400px;
|
||||
color: #FFF;
|
||||
background: url(header.gif) no-repeat top left;
|
||||
height: 21px;
|
||||
}
|
||||
|
||||
#content_title a, #content_title a:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
padding-top: 15px;
|
||||
padding-left: 18px;
|
||||
font-size:12px;
|
||||
color: #fff;
|
||||
background: url(rightheader.gif) no-repeat top left;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
#zaglavlje {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0px;
|
||||
padding-top: 3px;
|
||||
padding-left: 26px;
|
||||
color: #fff;
|
||||
height: 73px;
|
||||
background: url(rightcontent.gif) no-repeat;
|
||||
}
|
||||
|
||||
#logo {
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
#lijeva_kolona {
|
||||
float: left;
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
#lijeva_kolona a, #lijeva_kolona a:visited {
|
||||
display: block;
|
||||
background: url(menulink.gif);
|
||||
padding-top: 3px;
|
||||
padding-left: 20px;
|
||||
height: 20px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
#lijeva_kolona a:hover {
|
||||
color: #FFF;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sadrzaj {
|
||||
width: 750px;
|
||||
margin: 5px auto;
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
#desna_kolona {
|
||||
float: right;
|
||||
width: 240px;
|
||||
background: #FFF url(rightcontent.gif);
|
||||
text-align:justify;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.srednja_kolona {
|
||||
margin-left: 135px;
|
||||
margin-right: 240px;
|
||||
max-width: 34em;
|
||||
background: url(content.gif) top left;
|
||||
text-align:justify;
|
||||
}
|
||||
|
||||
#menuheader {
|
||||
background: url(menuheader.gif) no-repeat;
|
||||
height: 23px;
|
||||
}
|
||||
|
||||
#menufooter {
|
||||
background: url(menufooter.gif) no-repeat left top;
|
||||
height: 21px;
|
||||
}
|
||||
|
||||
.text {
|
||||
padding: 40px 18px 25px 18px;
|
||||
color: #FFF;
|
||||
background: url(footer.gif) no-repeat left bottom;
|
||||
}
|
||||
|
||||
.text_desno {
|
||||
padding: 0px 18px 25px 18px;
|
||||
color: #e2e2e2;
|
||||
background: url(rightfooter.gif) no-repeat left bottom;
|
||||
}
|
||||
|
||||
#info {
|
||||
color: #ccc;
|
||||
background: #5982B3;
|
||||
font-size: 9px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
padding: 5px;
|
||||
border: 1px solid #6F92BD;
|
||||
}
|
||||
|
||||
#hmenu {
|
||||
padding: 13px 0 5px 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#hmenu a {
|
||||
padding: 12px 13px 2px 11px;
|
||||
text-decoration: none;
|
||||
color: #414141;
|
||||
background: #ccc url(hmenuarrow.gif) no-repeat top center;
|
||||
margin: 0 0 3px 1px;
|
||||
border-bottom: 4px solid #BCBCBC;
|
||||
}
|
||||
|
||||
#hmenu a:hover {
|
||||
background: #3C6491 url(hmenuarrowhover.gif) no-repeat top center;
|
||||
color: #FFFFFF;
|
||||
border-bottom: 4px solid #2F4A6C;
|
||||
}
|
@ -1 +0,0 @@
|
||||
/* Styles specific to the index.php page */
|
@ -9,7 +9,7 @@ if (isAIX()) { $aixDisabled = 'disabled'; }
|
||||
require_once("lib/GroupNodeTable.class.php");
|
||||
require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
|
||||
insertHeader('Nodes', NULL, NULL, array('machines','nodes'));
|
||||
insertHeader('Nodes', array('index.css'), NULL, array('machines','nodes'));
|
||||
|
||||
echo "<div id=content align=center>\n";
|
||||
|
||||
@ -58,17 +58,17 @@ insertButtons(array(
|
||||
|
||||
echo '<form name="nodelist" class=ContentForm>';
|
||||
|
||||
/* $output = array(); runcmd("\bin\sudo listattr", 2, $output); foreach ($output as $line) { echo "<p>line=$line</p>"; } */
|
||||
/* $output = array(); runcmd("/bin/sudo listattr", 2, $output); foreach ($output as $line) { echo "<p>line=$line</p>"; } */
|
||||
|
||||
GroupNodeTable::insertGroupTableHeader();
|
||||
|
||||
// Get all the names of the groups
|
||||
$xcmdr = new XCATCommandRunner();
|
||||
$nodeGroupNames = $xcmdr->getAllXCATGroups();
|
||||
// Get the names and status of the groups
|
||||
$groups = getGroupStatus();
|
||||
|
||||
// Print the HTML for each of them
|
||||
foreach($nodeGroupNames as $key => $nodeGroupName) {
|
||||
echo GroupNodeTable::insertGroupTableRow($nodeGroupName);
|
||||
foreach($groups as $group => $status) {
|
||||
//echo "<p>$group status is $status</p>";
|
||||
echo GroupNodeTable::insertGroupTableRow($group, $status);
|
||||
}
|
||||
|
||||
GroupNodeTable::insertGroupTableFooter();
|
||||
@ -77,18 +77,9 @@ echo <<<EOS
|
||||
<!-- <SCRIPT language="JavaScript"> XCATEvent.doExpandNodes(); </SCRIPT> -->
|
||||
</form>
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="images/green-ball-m.gif"></td>
|
||||
<td align=left>Node is good (Status is ready/pbs/sshd)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="images/red-ball-m.gif"></td>
|
||||
<td align=left>Node is bad (Status is 'noping')</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="images/yellow-ball-m.gif"></td>
|
||||
<td align=left>Other status (unknown/node unavailable...)</td>
|
||||
</tr>
|
||||
<tr><td><img src="$TOPDIR/images/green-ball-m.gif"></td><td align=left>Node is good (Status is ready/pbs/sshd)</td></tr>
|
||||
<tr><td><img src="$TOPDIR/images/red-ball-m.gif"></td><td align=left>Node is bad (Status is 'noping')</td></tr>
|
||||
<tr><td><img src="$TOPDIR/images/yellow-ball-m.gif"></td><td align=left>Other status (unknown/node unavailable...)</td></tr>
|
||||
</table>
|
||||
<p id=disclaimer>This interface is still under construction and not yet ready for use.</p>
|
||||
</div>
|
||||
|
@ -54,9 +54,8 @@ EOS;
|
||||
/**
|
||||
* @param String nodeGroup The group.
|
||||
*/
|
||||
function insertGroupTableRow($nodeGroup) {
|
||||
$nodeGroupName = $nodeGroup->getName();
|
||||
$img_string = XCATNodeGroupUtil::getImageString($nodeGroup->getStatus());
|
||||
function insertGroupTableRow($nodeGroupName, $status) {
|
||||
$img_string = getStatusImage(GroupNodeTable::determineStatus($status));
|
||||
|
||||
//echo '<tr bgcolor="#FFCC00"><td align=left>';
|
||||
echo '<tr class=TableRow><td align=left>';
|
||||
@ -67,7 +66,7 @@ echo <<<EOE
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>$img_string</td>
|
||||
<td><img src="$img_string"></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
@ -81,7 +80,7 @@ return;
|
||||
* @param XCATNodeGroup nodeGroup The node group for which we want to generate the html.
|
||||
* returns the table that contains all the nodes information of that group
|
||||
*/
|
||||
function getXCATNodeGroupSection($nodeGroup) {
|
||||
function getNodeGroupSection($nodeGroup) {
|
||||
$imagedir = 'images';
|
||||
$right_arrow_gif = $imagedir . "/grey_arrow_r.gif";
|
||||
$left_arrow_gif = $imagedir . "/grey_arrow_l.gif";
|
||||
@ -97,7 +96,7 @@ EOS;
|
||||
$nodes = $nodeGroup->getNodes();
|
||||
|
||||
foreach($nodes as $nodeName => $node) {
|
||||
$html .= GroupNodeTable::getXCATNodeTableRow($node);
|
||||
$html .= GroupNodeTable::getNodeTableRow($node);
|
||||
}
|
||||
|
||||
$html .= "<TR bgcolor=\"#FFFF66\"><TD colspan=9 align=\"right\"><image src=\"$left_arrow_gif\" alt=\"Previous page\"> <image src=\"$right_arrow_gif\" alt=\"Next page\"> </TD></TR>";
|
||||
@ -111,7 +110,7 @@ EOS;
|
||||
/**
|
||||
* @param XCATNode node The node for which we want to generate the html.
|
||||
*/
|
||||
function getXCATNodeTableRow($node) {
|
||||
function getNodeTableRow($node) {
|
||||
|
||||
$imagedir = 'images';
|
||||
|
||||
@ -123,7 +122,7 @@ function getXCATNodeTableRow($node) {
|
||||
"<td width=43><div align=center>" . $node->getMode(). "</div></td>";
|
||||
|
||||
$stat = $node->getStatus();
|
||||
$img_string = XCATNodeGroupUtil::getImageString($stat);
|
||||
$img_string = '<img src="' . getStatusImage($stat) . '">';
|
||||
|
||||
$html .= "<td width=43><div align=center>" . $img_string . "</div></td>".
|
||||
"<td width=85><div align=center>" . $node->getHwCtrlPt(). "</div></td>".
|
||||
@ -132,5 +131,19 @@ function getXCATNodeTableRow($node) {
|
||||
EOS;
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String nodestatStr The status of the node as output by the nodestat command
|
||||
* @return "good", "bad", "warning", or "unknown"
|
||||
*/
|
||||
function determineStatus($statStr) {
|
||||
$status = NULL;
|
||||
if ($statStr == "ready" || $statStr == "pbs" || $statStr == "sshd") { $status = "good"; }
|
||||
else if ($statStr == "noping") { $status = "bad"; }
|
||||
else if ($statStr == "ping") { $status = "warning"; }
|
||||
else { $status = "unknown"; }
|
||||
return $status;
|
||||
}
|
||||
|
||||
} // end the class
|
||||
?>
|
||||
|
@ -1,10 +1,8 @@
|
||||
<?php
|
||||
//require_once("config.php");
|
||||
require_once("lib/XCAT/XCATNode/XCATNodeGroupUtil.class.php");
|
||||
require_once("lib/XCAT/XCATNode/XCATNode.class.php");
|
||||
require_once("lib/XCAT/XCATNode/XCATNodeManager.class.php");
|
||||
require_once("lib/XCAT/XCATNodeGroup/XCATNodeGroup.class.php");
|
||||
require_once("lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php");
|
||||
require_once("../lib/XCAT/XCATNode/XCATNode.class.php");
|
||||
require_once("../lib/XCAT/XCATNode/XCATNodeManager.class.php");
|
||||
require_once("../lib/XCAT/XCATNodeGroup/XCATNodeGroup.class.php");
|
||||
require_once("../lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php");
|
||||
|
||||
class XCATCommandRunner {
|
||||
var $XCATRoot;
|
||||
@ -39,18 +37,6 @@ class XCATCommandRunner {
|
||||
return $outputStat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will always return an up to date list of node names.
|
||||
*
|
||||
* @return An array containing names of all nodes.
|
||||
*/
|
||||
function getAllNodeNames() {
|
||||
$cmdString = $this->Sudo . $this->XCATRoot . "/nodels";
|
||||
$outputStat = $this->runCommand($cmdString);
|
||||
|
||||
return $outputStat["output"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Will always return an up to date list of node names belonging to the group.
|
||||
*
|
||||
@ -74,7 +60,7 @@ class XCATCommandRunner {
|
||||
|
||||
$xcn = new XCATNode();
|
||||
$xcn->setName($nodeName);
|
||||
$xcn->setStatus(XCATNodeGroupUtil::determineNodeStatus($outputStat["output"][0]));
|
||||
$xcn->setStatus($this->determineNodeStatus($outputStat["output"][0]));
|
||||
$xcn->setHwType("HW Type");
|
||||
$xcn->setOs("OS");
|
||||
$xcn->setMode("Mode");
|
||||
@ -88,6 +74,26 @@ class XCATCommandRunner {
|
||||
return $xcn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String nodestatStr The status of the node as output by the nodestat command
|
||||
* @return "good", "bad", or "other"
|
||||
*/
|
||||
function determineNodeStatus($nodestatStr) {
|
||||
$status = NULL;
|
||||
|
||||
if ((strpos($nodestatStr, "ready") != FALSE) ||
|
||||
(strpos($nodestatStr, "pbs") != FALSE) ||
|
||||
(strpos($nodestatStr, "sshd") != FALSE)) {
|
||||
$status = 'good';
|
||||
} else if(strpos($nodestatStr, "noping") != FALSE) {
|
||||
$status = 'bad';
|
||||
} else {
|
||||
$status = 'other';
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An array containing the name of every node group.
|
||||
*/
|
||||
@ -122,80 +128,5 @@ class XCATCommandRunner {
|
||||
return $xcatNodeGroup;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will run the command to get all
|
||||
* the groups, and then for each group, it will get
|
||||
* their nodes, and for each node, it will get its
|
||||
* information once.
|
||||
*/
|
||||
function getAllXCATGroups() {
|
||||
$xcatGroupNames = $this->getAllGroupNames();
|
||||
|
||||
$xcatGroups = array();
|
||||
|
||||
$groupStatArr = $this->getGroupStatus(); //get the status of all the groups
|
||||
|
||||
foreach($xcatGroupNames as $groupName) {
|
||||
//echo "<p>group=$groupName</p>";
|
||||
$xcatGroup = $this->getXCATGroupByName($groupName, $groupStatArr);
|
||||
array_push($xcatGroups, $xcatGroup);
|
||||
}
|
||||
|
||||
|
||||
return $xcatGroups;
|
||||
}
|
||||
|
||||
function getXCATGroupByName($groupName, $groupStatArr){
|
||||
|
||||
$xcg = new XCATNodeGroup();
|
||||
$xcg->setName($groupName);
|
||||
$xcg->setStatus(XCATNodeGroupUtil::determineNodeStatus($groupStatArr[$groupName]));
|
||||
|
||||
return $xcg;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Will always return an up to date status of the groups
|
||||
*
|
||||
* @return An array containing the status of all the groups
|
||||
*/
|
||||
function getGroupStatus() {
|
||||
$cmdString = $this->Sudo . $this->CurrDir . "/grpattr"; // "/cmds/grpattr";
|
||||
$outputStat = $this->runCommand($cmdString);
|
||||
$groupStats = $outputStat["output"];
|
||||
$groupStatArr = array();
|
||||
foreach($groupStats as $key => $groupStat) {
|
||||
if (strpos($groupStat,':') != FALSE){
|
||||
$stat = substr($groupStat,strpos($groupStat,':') + 2); //there's a space between the colon and the status
|
||||
$grp = substr($groupStat,0, strpos($groupStat,':'));
|
||||
$groupStatArr[$grp] = $stat;
|
||||
}
|
||||
}
|
||||
|
||||
return $groupStatArr;
|
||||
}
|
||||
|
||||
function getNodeOrGroupStatus($nodegroupName, $group) {
|
||||
$stat = "";
|
||||
if ($group == FALSE){
|
||||
$cmdString = $this->Sudo . $this->XCATRoot . "/nodestat " . $nodegroupName;
|
||||
$outputStat = $this->runCommand($cmdString);
|
||||
$nodegroupStat = $outputStat["output"][0];
|
||||
|
||||
if (strpos($nodegroupStat,':') != FALSE){
|
||||
$stat = substr($nodegroupStat,strpos($nodegroupStat,':') + 2); //there's a space between the colon and the status
|
||||
}
|
||||
}else{
|
||||
$StatArr = $this->getGroupStatus();
|
||||
$stat = $StatArr[$nodegroupName];
|
||||
}
|
||||
|
||||
if ($stat != "") $stat = XCATNodeGroupUtil::determineNodeStatus($stat);
|
||||
|
||||
return $stat;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
//require_once("config.php");
|
||||
|
||||
/**
|
||||
* Contains some utilities for XCATNodes.
|
||||
*/
|
||||
class XCATNodeGroupUtil {
|
||||
|
||||
function XCATNodeGroupUtil() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String nodestatStr The status of the node as output by the nodestat command
|
||||
* @return "good", "bad", or "other"
|
||||
*/
|
||||
function determineNodeStatus($statStr) {
|
||||
$status = NULL;
|
||||
|
||||
if ((strpos($statStr, "ready") !== FALSE) ||
|
||||
(strpos($statStr, "pbs") !== FALSE) ||
|
||||
(strpos($statStr, "noping") === FALSE && strpos($statStr, "ping") !== FALSE ) ||
|
||||
(strpos($statStr, "sshd") !== FALSE)) {
|
||||
$status = "good";
|
||||
} else if(strpos($statStr, "noping") !== FALSE) {
|
||||
$status = "bad";
|
||||
} else {
|
||||
$status = "other";
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the image string based on the node/group status
|
||||
*/
|
||||
function getImageString($status){
|
||||
$imagedir = 'images';
|
||||
$greengif = $imagedir . "/green-ball-m.gif";
|
||||
$yellowgif = $imagedir . "/yellow-ball-m.gif";
|
||||
$redgif = $imagedir . "/red-ball-m.gif";
|
||||
|
||||
//node/group is good
|
||||
if (strstr($status, "good") == TRUE ){
|
||||
$stat_content = "<IMG src=\"" . $greengif. "\" alt=\"Node is good\"> ";
|
||||
}elseif (strstr($status, "bad") == TRUE){ //node is bad
|
||||
$stat_content = "<IMG src=\"" . $redgif. "\" alt=\"Node is bad\"> ";
|
||||
}else{ //other status
|
||||
$stat_content = "<IMG src=\"" . $yellowgif. "\" alt=\"Other status\"> ";
|
||||
}
|
||||
|
||||
return $stat_content;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Just returns the strings for the different node statuses.
|
||||
* This way these string constants are defined in just one place.
|
||||
*/
|
||||
class XCATNodeStatus {
|
||||
function good() {
|
||||
return "good";
|
||||
}
|
||||
|
||||
function bad() {
|
||||
return "bad";
|
||||
}
|
||||
|
||||
function other() {
|
||||
return "other";
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
require_once("XCAT/XCATNode/XCATNodeStatus.class.php");
|
||||
/**
|
||||
* Contains some utilities for XCATNodes.
|
||||
*/
|
||||
class XCATNodeUtil {
|
||||
function XCATNodeUtil() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String nodestatStr The status of the node as output by the nodestat command
|
||||
* @return "good", "bad", or "other"
|
||||
*/
|
||||
function determineNodeStatus($nodestatStr) {
|
||||
$status = NULL;
|
||||
|
||||
if ((strpos($nodestatStr, "ready") != FALSE) ||
|
||||
(strpos($nodestatStr, "pbs") != FALSE) ||
|
||||
(strpos($nodestatStr, "sshd") != FALSE)) {
|
||||
$status = XCATNodeStatus::good();
|
||||
} else if(strpos($nodestatStr, "noping") != FALSE) {
|
||||
$status = XCATNodeStatus::bad();
|
||||
} else {
|
||||
$status = XCATNodeStatus::other();
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once("lib/GroupNodeTable.class.php");
|
||||
require_once("../lib/GroupNodeTable.class.php");
|
||||
|
||||
/**
|
||||
* This class exposes an API for calling the XCAT PHP classes.
|
||||
@ -47,7 +47,7 @@ class XCATWebservice {
|
||||
}
|
||||
|
||||
function getXCATNodeRows($nodeGroupName) {
|
||||
$html = GroupNodeTable::getXCATNodeTableRow($nodeGroupName);
|
||||
$html = GroupNodeTable::getNodeTableRow($nodeGroupName);
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ $CURRDIR = '/opt/xcat/web';
|
||||
------------------------------------------------------------------------------------------------*/
|
||||
function insertHeader($title, $stylesheets, $javascripts, $currents) {
|
||||
global $TOPDIR;
|
||||
if (!$TOPDIR) $TOPDIR = '.';
|
||||
if (!$TOPDIR) $TOPDIR = '..';
|
||||
|
||||
echo <<<EOS
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11-strict.dtd">
|
||||
@ -27,8 +27,8 @@ echo <<<EOS
|
||||
<head>
|
||||
<title>$title</title>
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<script src="functions.js" type="text/javascript"></script>
|
||||
<link href="$TOPDIR/lib/style.css" rel="stylesheet">
|
||||
<script src="$TOPDIR/lib/functions.js" type="text/javascript"></script>
|
||||
|
||||
EOS;
|
||||
|
||||
@ -61,11 +61,11 @@ echo "</head><body>\n";
|
||||
echo <<<EOS
|
||||
<table id=headingTable border=0 cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td><img id=xcatImage src='images/xCAT_icon.gif'></td>
|
||||
<td><img id=xcatImage src='$TOPDIR/images/xCAT_icon.gif'></td>
|
||||
<td width='100%'>
|
||||
|
||||
EOS;
|
||||
//echo "<div id=top><img id=xcatImage src='./images/xCAT_icon.gif'><div id=menuDiv>\n";
|
||||
//echo "<div id=top><img id=xcatImage src='$TOPDIR/images/xCAT_icon.gif'><div id=menuDiv>\n";
|
||||
|
||||
insertMenus($currents);
|
||||
|
||||
@ -366,6 +366,16 @@ function getHWTypeImage($hwtype, $powermethod) { //-----------------------------
|
||||
}
|
||||
|
||||
|
||||
// Return the image that represents the status string passed in
|
||||
function getStatusImage($status) {
|
||||
global $TOPDIR;
|
||||
if ($status == 'good') { return "$TOPDIR/images/green-ball-m.gif"; }
|
||||
elseif ($status == 'warning') { return "$TOPDIR/images/yellow-ball-m.gif"; }
|
||||
elseif ($status == 'bad') { return "$TOPDIR/images/red-ball-m.gif"; }
|
||||
else { return "$TOPDIR/images/blue-ball-m.gif"; }
|
||||
}
|
||||
|
||||
|
||||
// Returns the specified user preference value. Not finished.
|
||||
function getPref($key) { //------------------------------------
|
||||
if ($key == 'MaxNodesDisplayed') { return 50; }
|
||||
@ -386,10 +396,25 @@ function getNodes($group, $noderange) { //------------------------------------
|
||||
|
||||
|
||||
// Returns the node groups defined in the cluster. Not finished.
|
||||
function getGroups() { //------------------------------------
|
||||
function getGroups() {
|
||||
return array('AllNodes','group1','group2');
|
||||
}
|
||||
|
||||
|
||||
// Returns the aggregate status of each node group in the cluster. The return value is a
|
||||
// hash in which the key is the group name and the value is the status as returned by nodestat.
|
||||
function getGroupStatus() {
|
||||
$groups = array();
|
||||
$output = array();
|
||||
runcmd("/bin/sudo grpattr", 2, $output);
|
||||
foreach ($output as $line) {
|
||||
//echo "<p>line=$line</p>";
|
||||
$vals = preg_split('/: */', $line);
|
||||
if (count($vals) == 2) { $groups[$vals[0]] = $vals[1]; }
|
||||
}
|
||||
return $groups;
|
||||
}
|
||||
|
||||
// Returns true if we are running on AIX ------------------------------------
|
||||
function isAIX() { } //todo: implement
|
||||
|
||||
@ -406,10 +431,10 @@ function insertTabs ($tablist, $currentTabIndex) { //---------------------------
|
||||
foreach ($tablist as $key => $tab) {
|
||||
if ($key != 0) { echo "<TD width=2></TD>"; }
|
||||
if ($currentTabIndex == $key) {
|
||||
echo "<TD align=center background='images/tab-current.gif'><b>$tab[0]</b></TD>";
|
||||
echo "<TD align=center background='$TOPDIR/images/tab-current.gif'><b>$tab[0]</b></TD>";
|
||||
}
|
||||
else {
|
||||
echo "<TD align=center background='images/tab.gif'><A href='$tab[1]'>$tab[0]</A></TD>";
|
||||
echo "<TD align=center background='$TOPDIR/images/tab.gif'><A href='$tab[1]'>$tab[0]</A></TD>";
|
||||
}
|
||||
}
|
||||
echo "</TR><TR><TD colspan=7 height=7 bgcolor='#CBCBCB'></TD></TR></TBODY></TABLE>\n";
|
@ -1,6 +1,6 @@
|
||||
#headingTable {
|
||||
margin: 0 20px 10px 20px;
|
||||
/* background: #FFF url(./images/top.jpg) repeat-x top; */
|
||||
/* background: #FFF url(../images/top.jpg) repeat-x top; */
|
||||
background-color: #002432;
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
margin: 0 auto 10px auto;
|
||||
padding: 0;
|
||||
color: #666;
|
||||
background: #FFF url(./images/top.jpg) repeat-x top;
|
||||
background: #FFF url(../images/top.jpg) repeat-x top;
|
||||
background-color: #002432;
|
||||
height: 65px;
|
||||
}
|
||||
@ -99,14 +99,6 @@ div#content {
|
||||
}
|
||||
*/
|
||||
|
||||
#disclaimer {
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
color: red;
|
||||
text-align: center;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.ContentForm { margin: 10px 2px 15px 2px; }
|
||||
|
||||
BODY {
|
||||
@ -114,7 +106,7 @@ BODY {
|
||||
font-family : Arial;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
background: url(images/background.gif) repeat-y;
|
||||
background: url(../images/background.gif) repeat-y;
|
||||
/* background: black; */
|
||||
font: normal 12px Tahoma, Verdana, Arial, Helvetica, Sans-Serif;
|
||||
line-height: 1.6em;
|
||||
@ -167,7 +159,7 @@ TABLE {font-size : 10pt; font-family : Arial;}
|
||||
|
||||
|
||||
a.button {
|
||||
background: transparent url('./images/bg_button_a.gif') no-repeat scroll top right;
|
||||
background: transparent url('../images/bg_button_a.gif') no-repeat scroll top right;
|
||||
color: #444;
|
||||
display: block;
|
||||
float: left;
|
||||
@ -180,7 +172,7 @@ a.button {
|
||||
}
|
||||
|
||||
a.button span {
|
||||
background: transparent url('./images/bg_button_span.gif') no-repeat;
|
||||
background: transparent url('../images/bg_button_span.gif') no-repeat;
|
||||
display: block;
|
||||
line-height: 14px;
|
||||
padding: 5px 0 5px 18px;
|
9
xCAT-web/machines/groups.css
Normal file
@ -0,0 +1,9 @@
|
||||
/* Styles specific to the groups.php page */
|
||||
|
||||
#disclaimer {
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
color: red;
|
||||
text-align: center;
|
||||
margin: 5px;
|
||||
}
|
89
xCAT-web/machines/groups.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
// Main page of the xCAT web interface
|
||||
|
||||
$TOPDIR = '..';
|
||||
require_once "$TOPDIR/lib/functions.php";
|
||||
if (isAIX()) { $aixDisabled = 'disabled'; }
|
||||
|
||||
require_once("$TOPDIR/lib/GroupNodeTable.class.php");
|
||||
require_once("$TOPDIR/lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
|
||||
insertHeader('Groups', array('groups.css'), NULL, array('machines','groups'));
|
||||
|
||||
echo "<div id=content align=center>\n";
|
||||
|
||||
insertButtons(array(
|
||||
array(
|
||||
'Attributes',
|
||||
'Create Like',
|
||||
'Create Group',
|
||||
'Ping',
|
||||
//'Updatenode',
|
||||
'Run Cmd',
|
||||
'Copy Files'
|
||||
),
|
||||
array(
|
||||
//'Soft Maint',
|
||||
'HW Ctrl',
|
||||
'RSA/MM/FSP',
|
||||
'Install',
|
||||
'Perf Mon',
|
||||
//'Webmin',
|
||||
'Diagnose',
|
||||
'Remove'
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'name=propButton value="Attributes"',
|
||||
'name=defineButton value="Create Like"',
|
||||
'name=createGroupButton value="Create Group"',
|
||||
'name=pingNodesButton value="Ping"',
|
||||
//'name=updateButton value="Updatenode"',
|
||||
'name=runcmdButton value="Run Cmd"',
|
||||
'name=copyFilesButton value="Copy Files"'
|
||||
),
|
||||
array(
|
||||
//'name=softMaintButton value="Soft Maint" onclick="this.form.nodesNeeded=1;"',
|
||||
'name=hwctrlButton value="HW Ctrl"',
|
||||
'name=rsaButton value="RSA/MM/FSP" onclick="this.form.nodesNeeded=1;"',
|
||||
'name=installButton value="Install"',
|
||||
'name=perfmonButton value="Perf Mon"',
|
||||
//'name=webminButton value="Webmin" onclick="this.form.nodesNeeded=1;"',
|
||||
'name=diagButton value="Diagnose" onclick="this.form.nodesNeeded=1;"',
|
||||
'name=removeButton value="Remove"'
|
||||
),
|
||||
*/
|
||||
));
|
||||
|
||||
echo '<form name="nodelist" class=ContentForm>';
|
||||
|
||||
/* $output = array(); runcmd("/bin/sudo listattr", 2, $output); foreach ($output as $line) { echo "<p>line=$line</p>"; } */
|
||||
|
||||
GroupNodeTable::insertGroupTableHeader();
|
||||
|
||||
// Get the names and status of the groups
|
||||
$groups = getGroupStatus();
|
||||
|
||||
// Print the HTML for each of them
|
||||
foreach($groups as $group => $status) {
|
||||
//echo "<p>$group status is $status</p>";
|
||||
echo GroupNodeTable::insertGroupTableRow($group, $status);
|
||||
}
|
||||
|
||||
GroupNodeTable::insertGroupTableFooter();
|
||||
|
||||
echo <<<EOS
|
||||
<!-- <SCRIPT language="JavaScript"> XCATEvent.doExpandNodes(); </SCRIPT> -->
|
||||
</form>
|
||||
<table>
|
||||
<tr><td><img src="$TOPDIR/images/green-ball-m.gif"></td><td align=left>Node is good (Status is ready/pbs/sshd)</td></tr>
|
||||
<tr><td><img src="$TOPDIR/images/red-ball-m.gif"></td><td align=left>Node is bad (Status is 'noping')</td></tr>
|
||||
<tr><td><img src="$TOPDIR/images/yellow-ball-m.gif"></td><td align=left>Other status (unknown/node unavailable...)</td></tr>
|
||||
</table>
|
||||
<p id=disclaimer>This interface is still under construction and not yet ready for use.</p>
|
||||
</div>
|
||||
</BODY>
|
||||
</HTML>
|
||||
EOS;
|
||||
?>
|
@ -1,127 +0,0 @@
|
||||
/*
|
||||
|
||||
This file is no longer used.
|
||||
|
||||
Styles for the navigation area and some other general styles.
|
||||
|
||||
Some of this came from:
|
||||
template: Artificial Intelligence
|
||||
author: luka cvrk (www.solucija.com)
|
||||
*/
|
||||
|
||||
.middle{ font: normal 1em Tahoma, Verdana, Arial, Helvetica, Sans-Serif; }
|
||||
|
||||
/* this overlaps the BlueBack class in style.css */
|
||||
.BlueBack{
|
||||
font: bold .9em Tahoma, Verdana, Arial, Helvetica, Sans-Serif;
|
||||
color:#003399;
|
||||
}
|
||||
|
||||
.White{
|
||||
font: bold .9em Tahoma, Verdana, Arial, Helvetica, Sans-Serif;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
|
||||
/* LINKS AND HEADINGS STYLING */
|
||||
|
||||
a { color: #546F92; background: inherit; }
|
||||
a:hover { color: #808080; background: inherit; }
|
||||
h1 { font: bold 2em "Trebuchet MS", Helvetica, Sans-Serif; margin: 0; color: #000000; background-color:transparent; }
|
||||
h2 { font: bold 1.4em "Trebuchet MS", Helvetica, Sans-Serif; }
|
||||
/* h3 { clear: both; font-size: 1.1em; color: #000; background: #fff url(images/h3bg.gif) no-repeat center left; padding: 0 14px; margin: 0;} */
|
||||
h3 { clear: both; font-size: 1.1em; color: #000; background-color: #fff; padding: 0 14px; margin: 0;}
|
||||
.blue { color: #546F92; background: inherit; }
|
||||
.image { float: left; border: 2px solid #e2e2e2; padding: 3px; margin: 0 15px 10px 0; }
|
||||
.no-border {border:0;}
|
||||
|
||||
.inner_table{
|
||||
/*border-collapse:collapse;*/
|
||||
border: 3px;
|
||||
/* background-color: green; */
|
||||
margin-left : 15px;
|
||||
margin-right : 0px;
|
||||
margin-top : 0px;
|
||||
}
|
||||
|
||||
td.BorderMe { border:1px dotted #CCC; }
|
||||
|
||||
tr.indent td { padding:0px 0 0px 10px; }
|
||||
|
||||
.none { display:none; }
|
||||
|
||||
|
||||
/* LEFT VERTICAL MENU/Navigation area */
|
||||
|
||||
#nav TD{
|
||||
white-space: nowrap;
|
||||
vertical-align : middle;
|
||||
}
|
||||
|
||||
#menu_level1 {
|
||||
/* float: left; */
|
||||
color: white; /* #3F5B7F; */
|
||||
/* background: #C2CEDE; */
|
||||
font-weight: bold;
|
||||
font-size:12px;
|
||||
width: 100%;
|
||||
/* height:100%; */
|
||||
padding: 0px 5px 0px 0px;
|
||||
border-bottom: 1px solid white;
|
||||
}
|
||||
/* menu_level1 rows are not links or lists, they are collapseable sections...
|
||||
#menu_level1 li { list-style: none; }
|
||||
#menu_level1 a:link,a:visited {
|
||||
display: block;
|
||||
color: #3F5B7F; font-weight: bold; background: #C2CEDE; width: 100%; height:100%; padding: 0px; font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
#menu_level1 a:hover { background: #9EB1C9 ; color: #fff; text-decoration: underline; }
|
||||
*/
|
||||
|
||||
#menu_level2 {
|
||||
/* float: left; */
|
||||
color: white; /* #3F5B7F; */
|
||||
/* background: #BDBDBD ; */
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
padding: 0px 5px 0px 3px;
|
||||
border-bottom: 1px solid white;
|
||||
}
|
||||
/* menu_level2 rows are not links or lists, they are collapseable sections...
|
||||
#menu_level2 li { list-style: none; }
|
||||
#menu_level2 a:link, a:visited {
|
||||
display: block;
|
||||
color: #3F5B7F; font-weight: bold; background: #BDBDBD;
|
||||
width: 100%;
|
||||
height:100%;
|
||||
padding: 0px 5px 0px 15px;
|
||||
text-decoration: none;
|
||||
}
|
||||
#menu_level2 a img { border: 0 none; }
|
||||
#menu_level2 a:hover { background: #999999; color: #fff; }
|
||||
#menu_level2 a.current { background: #999999; color: #fff; }
|
||||
#menu_level2.no-link { }
|
||||
*/
|
||||
|
||||
#menu_level3 {
|
||||
/* float: left; */
|
||||
color: #3F5B7F;
|
||||
font-weight: bold;
|
||||
/* background: #CCCCCC ; */
|
||||
border-bottom: 1px solid #fff;
|
||||
font-size:11px;
|
||||
padding: 0px 5px 0px 15px;
|
||||
/* width: 100%; */
|
||||
}
|
||||
/* #menu_level3 li { list-style: none; } */
|
||||
#menu_level3 a:link, a:visited {
|
||||
display: block;
|
||||
/* color: #3F5B7F; width: 110px; font-weight: bold; background: #CCCCCC; */
|
||||
/* height:100%; */
|
||||
text-decoration: none;
|
||||
}
|
||||
#menu_level3 a img { border: 0 none; }
|
||||
#menu_level3 a:hover { background: #999999; color: #fff; }
|
||||
/* #menu_level3 a.current { background: #999999; color: #fff; } */
|
||||
#menu_level3.CurrentMenuItem { background: #FFFFFF ; }
|
||||
|
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
require_once("globalconfig.php");
|
||||
require_once("XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
require_once("XCAT/XCATNode/XCATNodeManager.class.php");
|
||||
require_once("XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php");
|
||||
require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
require_once("lib/XCAT/XCATNode/XCATNodeManager.class.php");
|
||||
require_once("lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php");
|
||||
|
||||
$cmdRunner = new XCATCommandRunner($xCAT_ROOT);
|
||||
$var = $cmdRunner->getAllXCATNodeGroups();
|
||||
|
@ -1,14 +1,13 @@
|
||||
<?php
|
||||
require_once("globalconfig.php");
|
||||
require_once("lib/GroupNodeTable.class.php");
|
||||
require_once("XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php");
|
||||
|
||||
$nodeGroupName = @$_REQUEST["nodeGroupName"];
|
||||
|
||||
// Get all the nodes with node information of the group
|
||||
$xcmdr = new XCATCommandRunner();
|
||||
$nodeGroup = $xcmdr->getXCATNodeByGroupName($nodeGroupName);
|
||||
echo GroupNodeTable::getXCATNodeGroupSection($nodeGroup);
|
||||
echo GroupNodeTable::getNodeGroupSection($nodeGroup);
|
||||
|
||||
|
||||
?>
|
||||
|
@ -3,10 +3,7 @@
|
||||
Include files, insert header and menu bar
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
//require_once("globalconfig.php");
|
||||
|
||||
require_once "$TOPDIR/functions.php"; //NOTE: it is essential to include this file before include top.php and nav.php
|
||||
//require_once "$TOPDIR/nav.php";
|
||||
|
||||
insertHeader('Preferences', NULL, NULL);
|
||||
insertNav('prefs');
|
||||
|
@ -3,7 +3,6 @@
|
||||
* This file works in conjunction with lib/XCAT/webservice/XCATWebservice.class.php
|
||||
*/
|
||||
|
||||
require_once("globalconfig.php");
|
||||
require_once("lib/XCAT/webservice/XCATWebservice.class.php");
|
||||
|
||||
$methodName = $_REQUEST["method"];
|
||||
|