c99d72a179
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
32 lines
745 B
PHP
32 lines
745 B
PHP
<?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;
|
|
}
|
|
}
|
|
?>
|