xcat-core/xCAT-web/lib/XCAT/XCATNode/XCATNodeUtil.class.php
jbjohnso c99d72a179 Initial xCAT 2.0 import
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2007-10-26 22:44:33 +00:00

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;
}
}
?>