From bd63d8fc0b2fba6ef8569c3e4cd6e92ecd47a829 Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Fri, 26 Sep 2008 20:25:53 +0000 Subject: [PATCH] Web interface prototype ported to xcat 2. Now real development of it can start. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2236 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-web/cmds/grpattr | 2 + xCAT-web/images/top2.jpg | Bin 0 -> 4928 bytes xCAT-web/images/topl2.jpg | Bin 0 -> 5898 bytes xCAT-web/images/topr2.jpg | Bin 0 -> 5492 bytes xCAT-web/images/toptop.gif | Bin 0 -> 799 bytes xCAT-web/lib/GroupNodeTable.class.php | 23 ++- xCAT-web/lib/functions.php | 254 +++++++++++++++++++------- xCAT-web/lib/style.css | 25 ++- xCAT-web/machines/frames.php | 7 +- xCAT-web/machines/groups.css | 10 +- xCAT-web/machines/groups.php | 78 ++++++-- xCAT-web/machines/nodes_by_group.php | 10 +- xCAT-web/machines/test.css | 21 +++ xCAT-web/manage/dsh.php | 16 +- xCAT-web/manage/dsh_action.php | 109 +++++------ xCAT-web/xCAT-web.spec | 51 +++--- 16 files changed, 402 insertions(+), 204 deletions(-) create mode 100644 xCAT-web/images/top2.jpg create mode 100644 xCAT-web/images/topl2.jpg create mode 100644 xCAT-web/images/topr2.jpg create mode 100644 xCAT-web/images/toptop.gif create mode 100644 xCAT-web/machines/test.css diff --git a/xCAT-web/cmds/grpattr b/xCAT-web/cmds/grpattr index 3eb0c593c..d8959b38c 100644 --- a/xCAT-web/cmds/grpattr +++ b/xCAT-web/cmds/grpattr @@ -1,5 +1,7 @@ #!/usr/bin/perl +# NOTE: this cmd is not ported to xCAT 2.0 and is not used any more!!!!!! + # Display some aggregate information about each group, gathered from the db and its nodes use strict; diff --git a/xCAT-web/images/top2.jpg b/xCAT-web/images/top2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7e1f7a21d6bf30df4d4a3ced7f0121e942ebc343 GIT binary patch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P1u=c4r9U0Y^h~rGJbo!zIx%$cX>Md8$5h#9Z9ua0klvnb z7p6_e7jaK(%&WG(tLq)fhc3J@sBRSIY;6ln4$649|9#xYI8xwwx34v>uQf7*^__E9 zzH$GGu!(X^i;y+e5Zf==?0LvzBcza2J@y%)ZceXEs%Uxl zX7=lhho#Q@vANa=GuFVc{fp3QLiP)rfqg+6`*~NYN Ef35o~d;kCd literal 0 HcmV?d00001 diff --git a/xCAT-web/images/topr2.jpg b/xCAT-web/images/topr2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fb0107d1f4c9150fdd54efa6fa2ff840835d6809 GIT binary patch literal 5492 zcmbtY2Ut_d7M^?4LntAkBZS_hcTier5s+TQf{+9VB|xa6f+C`#YXQZAiUNv=!dfU| zK@hvE0t$!?WD&4}Qbdrv8?f&C_PzJ*n|$}qKWEO&{O8P>WKQ^<{B9t&z?tC;AP54k z$OrIy&=jXMPB;JzhBm+h0B}GYLIDUt5a>Y5LYNsGhP36r;wS`be$|1&nl*+H48#x_ z4|$9bOhxJ}vobaY2$MtK*Z=?@nw?P`nF;k3dm~s-umJUy6BcQG<1K<1@{PA7f`9NH;6w22 zYzl}R{)*qiGn4%rSN>1FgTMLiEg;#m;=_Z+s)SEtn6U{jtA&nJ z%kv%T8D=J$N*149r|y{V$8u^aNivga^?$+sa3=doTXOG5XN{eu>(B0Le(>kWk?N}t z`$hx8Q*sK9)?90UIcDw>7?HYRcUkTAj{b2nvS$ce^b98)7GpX?LCH`YjW9@1reKWL z?w|@7H2Sm*8LNi%@Ursgz7ottlVLTifB;V2w5b&#Q6j~1@;6IjzxYn!?-^+Ppuq0} zB-G5BWMB(=c3&8&aO+e{n_HDU(C|mKN6|>eNp9fCrLDIZs)u75`1iZ}RyH_I$5u2R zS$Pksk1u&@b21}jR-rh?mf!MmV%d00W?|Hj*0M=Kov-gqQamz};=@prv*x#c?5bE@ zV|4sle`k05+9&yE^$(>xv8$_jApv}F^__;t4X*!t%SEJzTjRUhi=M^u-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web/images/toptop.gif b/xCAT-web/images/toptop.gif new file mode 100644 index 0000000000000000000000000000000000000000..5194ba2f71f76c0f1b4a462cc004d9b40e1342b5 GIT binary patch literal 799 ucmZ?wbhEHbWMp7u_|Cw $attrs) { $html .= GroupNodeTable::getNodeTableRow($nodeName, $attrs); @@ -103,16 +103,19 @@ function getNodeGroupSection($group, $nodes) { function getNodeTableRow($nodeName, $attrs) { $html = "\n" . "$nodeName\n" . - "" . $attrs['arch'] . "\n" . - "" . $attrs['osversion'] . "\n" . - "" . $attrs['mode'] . "\n"; + "" . (array_key_exists('nodetype.arch',$attrs)?$attrs['nodetype.arch']:'') . "\n" . + "" . (array_key_exists('nodetype.os',$attrs)?$attrs['nodetype.os']:'') . "\n" . + "" . (array_key_exists('nodetype.profile',$attrs)?$attrs['nodetype.profile']:'') . "\n"; - $stat = 'unknown'; //todo: implement + $stat = 'unknown'; //todo: implement when nodels nodelist.status works $img_string = ''; - $html .= "" . $img_string . "". - "" . $attrs['power'] . "". - "" . $attrs['comment'] . ""; + $powerstr = array_key_exists('nodehm.power',$attrs) ? $attrs['nodehm.power'] : NULL; + if (empty($powerstr)) { $powerstr = array_key_exists('nodehm.mgt',$attrs)?$attrs['nodehm.mgt']:''; } + + $html .= "" . $img_string . "". + "" . $powerstr . "". + "" . (array_key_exists('nodelist.comments',$attrs)?$attrs['nodelist.comments']:'') . ""; return $html; } @@ -123,7 +126,7 @@ function getNodeTableRow($nodeName, $attrs) { */ function determineStatus($statStr) { $status = NULL; - if ($statStr == "ready" || $statStr == "pbs" || $statStr == "sshd") { $status = "good"; } + if ($statStr == "alive" || $statStr == "ready" || $statStr == "pbs" || $statStr == "sshd") { $status = "good"; } else if ($statStr == "noping") { $status = "bad"; } else if ($statStr == "ping") { $status = "warning"; } else { $status = "unknown"; } diff --git a/xCAT-web/lib/functions.php b/xCAT-web/lib/functions.php index 7fcd2c3cf..c9882dffd 100644 --- a/xCAT-web/lib/functions.php +++ b/xCAT-web/lib/functions.php @@ -7,10 +7,12 @@ session_start(); // retain session variables across page requests if (!isset($TOPDIR)) { $TOPDIR = '..'; } // The settings below display error on the screen, instead of giving blank pages. -error_reporting(E_ALL ^ E_NOTICE); +//error_reporting(E_ALL ^ E_NOTICE); +error_reporting(E_ALL); ini_set('display_errors', true); +//----------------------------------------------------------------------------- /** * Inserts the header part of the HTML and the top part of the page, including the menu. * Also includes some common css and js files and the css and js files specified. @@ -53,7 +55,7 @@ echo "\n"; echo << - + @@ -62,7 +64,7 @@ EOS; insertMenus($currents); -echo "\n"; +echo "\n"; //echo "\n"; // end the top div } // end insertHeader @@ -126,10 +128,10 @@ $MENU = array( 'list' => array( 'diagnose' => array('label' => 'Diagnose', 'url' => "$TOPDIR/support/diagnose.php"), 'update' => array('label' => 'Update', 'url' => "$TOPDIR/support/update.php"), - 'howtos' => array('label' => 'HowTos', 'url' => "$TOPDIR/support/howtos.php"), - 'manpages' => array('label' => 'Man Pages', 'url' => "$TOPDIR/support/manpages.php"), - 'maillist' => array('label' => 'Mail List', 'url' => "http://xcat.org/mailman/listinfo/xcat-user"), - 'wiki' => array('label' => 'Wiki', 'url' => "http://xcat.wiki.sourceforge.net/"), + 'howtos' => array('label' => 'HowTos', 'url' => getDocURL('howto')), + 'manpages' => array('label' => 'Man Pages', 'url' => getDocURL('manpage')), + 'maillist' => array('label' => 'Mail List', 'url' => getDocURL('web','mailinglist')), + 'wiki' => array('label' => 'Wiki', 'url' => getDocURL('web','wiki')), 'suggest' => array('label' => 'Suggestions', 'url' => "$TOPDIR/support/suggest.php"), 'about' => array('label' => 'About', 'url' => "$TOPDIR/support/about.php"), ) @@ -137,6 +139,7 @@ $MENU = array( ); +//----------------------------------------------------------------------------- // Insert the menus at the top of the page // $currents is an array of the current menu choice tree function insertMenus($currents) { @@ -152,6 +155,7 @@ function insertMenus($currents) { } +//----------------------------------------------------------------------------- // Insert one set of choices under a main choice. function insertMenuRow($current, $isTop, $items) { global $TOPDIR; @@ -182,10 +186,82 @@ function insertMenuRow($current, $isTop, $items) { //echo "\n"; //echo "\n"; - echo "\n"; + echo "\n\n"; } +//----------------------------------------------------------------------------- +// Inserts the html for each pages footer +function insertFooter() { +echo ''; +} + + +//----------------------------------------------------------------------------- +// Run a cmd via the xcat client/server protocol +// args is an array of arguments to the cmd +// Returns a tree of SimpleXML objects. See perl-xCAT/xCAT/Client.pm for the format. +function docmd($cmd, $nr, $args){ + $request = simplexml_load_string(''); + $request->addChild('command',$cmd); + foreach ($args as $a) { + $request->addChild('arg',$a); + } + if(!empty($nr)){ + $request->addChild('noderange',$nr); + } + #echo $request->asXML(); + $xml = submit_request($request,0); + return $xml; +} + + +//----------------------------------------------------------------------------- +// Used by docmd() +// req is a tree of SimpleXML objects +// Returns a tree of SimpleXML objects. See perl-xCAT/xCAT/Client.pm for the format. +function submit_request($req, $skipVerify){ + #global $cert,$port,$xcathost; + $apachehome = '/var/www'; #todo: for sles this should be /var/lib/wwwrun + $cert = "$apachehome/.xcat/client-cred.pem"; + $xcathost = "localhost"; + $port = "3001"; + $rsp = 0; + $response = ''; + $cleanexit=0; + + // Open a socket to xcatd + $context = stream_context_create(array('ssl'=>array('local_cert' => $cert))); + if($fp = stream_socket_client('ssl://'.$xcathost.':'.$port,$errno,$errstr,30, + STREAM_CLIENT_CONNECT,$context)){ + fwrite($fp,$req->asXML()); // send the xml to xcatd + while(!feof($fp)){ // and then read until there is no more + $response .= preg_replace('/\n/','', stream_get_contents($fp)); // remove newlines and add it to the response + + // Look for the serverdone response + $pattern = '/\s*\s*<\/serverdone>\s*<\/xcatresponse>\s*$/'; + if(preg_match($pattern,$response)) { // transaction is done, pkg up the xml and return it + #echo htmlentities($response); + $response = '' . preg_replace($pattern,'', $response) . ''; // remove the serverdone response and put an xcat tag around the rest + $rsp = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOCDATA); + $cleanexit = 1; + } + } + fclose($fp); + }else{ + echo "

xCAT Submit request Error: $errno - $errstr

\n"; + } + if(! $cleanexit){ + if(!$skipVerify){ + echo "

Error: xCAT response ended prematurely.

"; + $rsp = 0; + } + } + return $rsp; +} + + + /** ---------------------------------------------------------------------------------------------- Function to run the commands on the remote nodes. Four arguments: 1. The command @@ -238,8 +314,9 @@ function runcmd ($cmd, $mode, &$output, $options=NULL){ } +//----------------------------------------------------------------------------- // Send the keys and values in the primary global arrays -function dumpGlobals() { //------------------------------------ +function dumpGlobals() { trace('$_SERVER:'); foreach ($_SERVER as $key => $val) { trace("$key = $val"); } trace('
$_ENV:'); @@ -253,8 +330,12 @@ function dumpGlobals() { //------------------------------------ } } + +//----------------------------------------------------------------------------- function getXcatRoot() { return isset($_ENV['XCATROOT']) ? $_ENV['XCATROOT'] : '/opt/xcat'; } + +//----------------------------------------------------------------------------- # Returns true if the given rpm file is already installed at this version or higher. function isInstalled($rpmfile) { $aixrpmopt = isAIX() ? '--ignoreos' : ''; @@ -271,6 +352,7 @@ function isInstalled($rpmfile) { $isSupportedHash = array(); +//----------------------------------------------------------------------------- # Returns true if the specified feature is supported. This is normally determined by some fast # method like checking for the existence of a file. The answer is also cached for next time. function isSupported($feature) { @@ -297,9 +379,10 @@ define("TRACE", "1"); function trace($str) { if (TRACE) { echo "

$str

\n"; } } +//----------------------------------------------------------------------------- // Take in a hostname or ip address and return the fully qualified primary hostname. If resolution fails, // it just returns what it was given. -function resolveHost($host) { //------------------------------------ +function resolveHost($host) { if (isIPAddr($host)) { // IP address $hostname = gethostbyaddr($host); return $hostname; @@ -312,23 +395,41 @@ function resolveHost($host) { //------------------------------------ } } -//------------------------------------ +//----------------------------------------------------------------------------- function isIPAddr ($host) { return preg_match('/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/', $host); } -// Returns the URL for the requested documentation. This provides 1 level of indirection in case the location -// of some of the documentation changes. -function getDocURL($book, $section) { //------------------------------------ +//----------------------------------------------------------------------------- +// Returns the URL for the requested documentation. This provides 1 level of indirection in case +// the location of some of the documentation changes. +// book is the name (minus the dollar sign) of one of the arrays below. +// section is the book/website/table name, or in the case of manpage: cmd.section# +function getDocURL($book, $section = NULL) { + global $TOPDIR; $web = array ( - 'docs' => "http://xcat.org/doc", - 'forum' => "http://xcat.org/mailman/listinfo/xcat-user", - 'updates' => "http://www.alphaworks.ibm.com/tech/xCAT", - 'opensrc' => "http://www-rcf.usc.edu/~garrick", - 'wiki' => "http://www.asianlinux.org/xcat", + 'docs' => "http://xcat.svn.sourceforge.net/svnroot/xcat/xcat-core/trunk/xCAT-client/share/doc", + 'mailinglist' => "http://xcat.org/mailman/listinfo/xcat-user", + 'updates' => "http://xcat.sourceforge.net/yum", + 'opensrc' => "http://xcat.sourceforge.net/yum", + 'wiki' => "http://xcat.wiki.sourceforge.net", ); - $man = array (); - $howto = array (); - $rsctadmin = array ( + $manpage = array( + 0 => "$TOPDIR/../xcat-doc", + 1 => "$TOPDIR/../xcat-doc/man1/xcat.1.html", + ); + $dbtable = array( + 0 => "$TOPDIR/../xcat-doc/man5", + 1 => "$TOPDIR/../xcat-doc/man5/xcatdb.5.html", + ); + $howto = array( + 0 => "$TOPDIR/../xcat-doc", + 1 => "$TOPDIR/../xcat-doc/index.html", + 'linuxCookbook' => "$TOPDIR/../xcat-doc/xCAT2.pdf", + 'idataplexCookbook' => "$TOPDIR/../xcat-doc/xCAT-iDpx.pdf", + 'aixCookbook' => "$TOPDIR/../xcat-doc/xCAT2onAIX.pdf", + ); + /* + $rsctadmin = array ( //todo: update this 0 => "http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.rsct.doc/rsct_aix5l53", 1 => "$rsctadmin[0]/bl5adm1002.html", 'sqlExpressions' => "$rsctadmin[0]/bl5adm1042.html#ussexp", @@ -336,8 +437,7 @@ function getDocURL($book, $section) { //------------------------------------ 'responses' => "$rsctadmin[0]/bl5adm1041.html#cmrresp", 'resourceClasses' => "$rsctadmin[0]/bl5adm1039.html#lavrc", ); - - $rsctref = array ( + $rsctref = array ( //todo: update this 0 => "http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.rsct.doc/rsct_linux151", 1 => "$rsctref[0]/bl5trl1002.html", 'errm' => "$rsctref[0]/bl5trl1067.html#errmcmd", @@ -347,11 +447,23 @@ function getDocURL($book, $section) { //------------------------------------ 'lscondresp' => "$rsctref[0]/bl5trl1071.html#lscondresp", 'startcondresp' => "$rsctref[0]/bl5trl1079.html#startcondresp", ); + */ if ($book) { - if (!$section) { $section = 1; } // link to whole book if no section specified - $url = &$$book; - return $url[$section]; + //$url = &$$book; + if ($book=='web') $url = & $web; + elseif ($book=='manpage') $url = & $manpage; + elseif ($book=='dbtable') $url = & $dbtable; + elseif ($book=='howto') $url = & $howto; + else return NULL; + + if (!$section) { return $url[1]; } // link to whole book if no section specified + if ($book=='manpage') { + $m = explode('.',$section); // 1st part is cmd name, 2nd part is man section + return "$url[0]/man$m[1]/$m[0].$m[1].html"; + } + elseif ($book=='dbtable') { return "$url[0]/$section.5.html"; } + else return $url[$section]; } else { // produce html for a page that contains all the links above, for testing purposes return ''; //todo: @@ -359,8 +471,9 @@ function getDocURL($book, $section) { //------------------------------------ } +//----------------------------------------------------------------------------- // This returns important display info about each type of hardware, so we can easily add new hw types. -function getHWTypeInfo($hwtype, $attr) { //------------------------------------ +function getHWTypeInfo($hwtype, $attr) { //todo: get the aliases to be keys in this hash too $hwhash = array ( 'x335' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8676' ), @@ -431,8 +544,9 @@ function getHWTypeInfo($hwtype, $attr) { //------------------------------------ } +//----------------------------------------------------------------------------- // Returns the image that should be displayed for this type of hw. Gets this from getHWTypeInfo() -function getHWTypeImage($hwtype, $powermethod) { //------------------------------------ +function getHWTypeImage($hwtype, $powermethod) { # 1st try to match the hw type $info = getHWTypeInfo($hwtype, 'image'); if ($info) { return $info['image']; } @@ -451,6 +565,7 @@ function getHWTypeImage($hwtype, $powermethod) { //----------------------------- } +//----------------------------------------------------------------------------- // Return the image that represents the status string passed in function getStatusImage($status) { global $TOPDIR; @@ -461,6 +576,7 @@ function getStatusImage($status) { } +//----------------------------------------------------------------------------- // Returns the specified user preference value, or the default. (The preferences are stored in cookies.) // If no key is specified, it will return the list of preference names. function getPref($key) { @@ -474,69 +590,76 @@ function getPref($key) { } +//----------------------------------------------------------------------------- // Returns a list of some or all of the nodes in the cluster and some of their attributes. // Pass in a node range (or NULL to get all nodes) and an array of attribute names (or NULL for none). // Returns an array where each key is the node name and each value is an array of attr/value pairs. +// attrs is an array of attributes that should be returned. function getNodes($noderange, $attrs) { //my ($hostname, $type, $osname, $distro, $version, $mode, $status, $conport, $hcp, $nodeid, $pmethod, $location, $comment) = split(/:\|:/, $na); //$nodes[] = array('hostname'=>"node$i.cluster.com", 'type'=>'x3655', 'osname'=>'Linux', 'distro'=>'RedHat', 'version'=>'4.5', 'status'=>1, 'conport'=>$i, 'hcp'=>"node$i-bmc.cluster.com", 'nodeid'=>'', 'pmethod'=>'bmc', 'location'=>"frame=1 u=$", 'comment'=>''); $nodes = array(); - foreach ($attrs as $a) { - $output = array(); - //echo "

nodels $noderange $a

\n"; - runcmd("nodels $noderange $a", 2, $output); - foreach ($output as $line) { - $vals = preg_split('/: */', $line); // vals[0] will be the node name - if (!$nodes[$vals[0]]) { $nodes[$vals[0]] = array(); } - $attributes = & $nodes[$vals[0]]; - if ($a == 'type') { - $types = preg_split('/-/', $vals[1]); - $attributes['osversion'] = $types[0]; - $attributes['arch'] = $types[1]; - $attributes['type'] = $types[2]; - } - } + //$xml = docmd('nodels',$noderange,implode(' ',$attrs)); + $xml = docmd('nodels',$noderange,$attrs); + $output = $xml->xcatresponse->children(); // technically, we should iterate over the xcatresponses, because there can be more than one + foreach ($output as $o) { + $nodename = (string)$o->name; + $data = $o->data; + $attrval = (string)$data->contents; + $attrname = (string)$data->desc; + //echo "

$attrname = $attrval

\n"; + //echo "

"; print_r($nodename); echo "

\n"; + //echo "

"; print_r($o); echo "

\n"; + //$nodes[$nodename] = array('osversion' => $attr); + if (!array_key_exists($nodename,$nodes)) { $nodes[$nodename] = array(); } + $attributes = & $nodes[$nodename]; + $attributes[$attrname] = $attrval; } return $nodes; } +//function awalk($value, $key) { echo "

$key=$value.

\n"; } +//function awalk2($a) { foreach ($a as $key => $value) { if (is_array($value)) {$v='';} else {$v=$value;} echo "

$key=$v.

\n"; } } + +//----------------------------------------------------------------------------- // Returns the node groups defined in the cluster. function getGroups() { $groups = array(); - $output = array(); - runcmd("listattr", 2, $output); - foreach ($output as $grp) { $groups[] = $grp; } - return $groups; -} - - -// 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("grpattr", 2, $output); + $xml = docmd('tabdump','',array('nodelist')); + $output = $xml->xcatresponse->children(); + #$output = $xml->children(); // technically, we should iterate over the xcatresponses, because there can be more than one foreach ($output as $line) { //echo "

line=$line

"; - $vals = preg_split('/: */', $line); - if (count($vals) == 2) { $groups[$vals[0]] = $vals[1]; } + $vals = array(); + preg_match('/^"([^"]*)","([^"]*)"/', $line, $vals); //todo: create function to parse tabdump output better + if (count($vals) > 2) { + //$node = $vals[1]; + $grplist = preg_split('/,/', $vals[2]); + foreach ($grplist as $g) { $groups[$g] = 1; } + } } - return $groups; + $grplist = array_keys($groups); + sort($grplist); + return $grplist; } -// Returns true if we are running on AIX ------------------------------------ +//----------------------------------------------------------------------------- +// Returns true if we are running on AIX function isAIX() { } //todo: implement -// Returns true if we are running on Linux ------------------------------------ +//----------------------------------------------------------------------------- +// Returns true if we are running on Linux function isLinux() { } //todo: implement -// Returns true if we are running on Windows ------------------------------------ +//----------------------------------------------------------------------------- +// Returns true if we are running on Windows function isWindows() { return array_key_exists('WINDIR', $_SERVER); } +//----------------------------------------------------------------------------- // Create file folder-like tabs. Tablist is an array of label/url pairs. -function insertTabs ($tablist, $currentTabIndex) { //------------------------------------ +function insertTabs ($tablist, $currentTabIndex) { echo ""; foreach ($tablist as $key => $tab) { if ($key != 0) { echo ""; } @@ -551,6 +674,7 @@ function insertTabs ($tablist, $currentTabIndex) { //--------------------------- } +//----------------------------------------------------------------------------- // Create the Action buttons in a table. Each argument passed in is a button, which is an array of attribute strings. // If your onclick attribute contains javascript code that uses quotes, use double quotes instead of single quotes. // Note: if only 1 button is passed in, the button is not put in a table. @@ -568,6 +692,7 @@ function insertButtons () { } +//----------------------------------------------------------------------------- // Display messages in the html. If severity is W or E, it will attempt to use the Error class // from the style sheet. function msg($severity, $msg) @@ -580,6 +705,7 @@ function msg($severity, $msg) } +//----------------------------------------------------------------------------- function insertNotDoneYet() { echo "

This page is not done yet.

\n"; } ?> diff --git a/xCAT-web/lib/style.css b/xCAT-web/lib/style.css index 6b213864b..62d1f7ee4 100644 --- a/xCAT-web/lib/style.css +++ b/xCAT-web/lib/style.css @@ -3,7 +3,8 @@ /* background-color: #002432; */ } -.TopMiddle { background: #FFF url(../images/top.jpg) repeat-x top; } +.TopTop { background: #FFF url(../images/toptop.jpg) repeat-x top; } +.TopMiddle { background: #FFF url(../images/top2.jpg) repeat-x top; padding-top: 1px; } /* #top { @@ -38,7 +39,7 @@ border-right: 2px solid white; } -#mainNav { /* the UL the contains the LIs of one row of menu items */ +#mainNav { /* the UL that contains the LIs of one row of menu items */ /* position: absolute; float: left; */ list-style: none; @@ -63,7 +64,7 @@ display: block; padding: 0 2em; /*2em;*/ margin: 0px; - background: #09334b; + background: #0B4360; /* #09334b; */ color: #fafafa; } @@ -95,7 +96,7 @@ } */ #mainNav a:hover { - background: #09334b; + background: #0B4360; /* #09334b; */ color: #fafafa; } @@ -123,6 +124,21 @@ div#content { .ContentForm { margin: 10px 2px 15px 2px; } +.PageFooter { + background-color : #e8e8e8; + margin: 10px; + padding: 5px; +} + +#disclaimer { + font-weight: bold; + font-size: 8pt; + font-style: italic; + color: red; + text-align: center; + margin: 5px; +} + BODY { margin: 0; padding: 10px; @@ -138,6 +154,7 @@ BODY { */ } +IMG { vertical-align: middle; } INPUT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;} SELECT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;} TEXTAREA {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;} diff --git a/xCAT-web/machines/frames.php b/xCAT-web/machines/frames.php index 38b55002c..ff4888994 100644 --- a/xCAT-web/machines/frames.php +++ b/xCAT-web/machines/frames.php @@ -4,8 +4,11 @@ $TOPDIR = '..'; require_once "$TOPDIR/lib/functions.php"; insertHeader('xCAT Frame Node List', NULL, NULL, array('machines','frames')); if (isAIX()) { $aixDisabled = 'disabled'; } -?> +insertNotDoneYet(); +echo ''; +/* This was copied from the csm web interface and can be used as the beginning code + for the frame view.
-

Node List on Management Server

@@ -349,3 +351,4 @@ if ($AIXdisable) {
+?> diff --git a/xCAT-web/machines/groups.css b/xCAT-web/machines/groups.css index bd41296dd..716968631 100644 --- a/xCAT-web/machines/groups.css +++ b/xCAT-web/machines/groups.css @@ -1,13 +1,7 @@ + /* Styles specific to the groups.php page */ -#disclaimer { - font-weight: bold; - font-size: 9pt; - color: red; - text-align: center; - margin: 5px; -} - .GroupNodeTable { margin-left: 10px; } +.GroupNodeTable TD { padding-left: 0.2em; padding-right: 0.2em; } .GroupNodeTableHeader { color: black; background-color : #FFFF66; font-weight : bold; white-space: nowrap; } .GroupNodeTableRow { color: black; background-color : #FFFF66; white-space: nowrap; } diff --git a/xCAT-web/machines/groups.php b/xCAT-web/machines/groups.php index b4a818f6e..45ace52eb 100644 --- a/xCAT-web/machines/groups.php +++ b/xCAT-web/machines/groups.php @@ -68,17 +68,69 @@ foreach($groups as $group => $status) { GroupNodeTable::insertGroupTableFooter(); -echo << XCATEvent.doExpandNodes(); --> - -
- - - -
Node is good (Status is ready/pbs/sshd)
Node is bad (Status is 'noping')
Other status (unknown/node unavailable...)
-

This interface is still under construction and not yet ready for use.

- - - -EOS; +echo ''; + +echo ''; +echo ''; +echo ''; +echo ''; + +echo '
Good Possible problem Problem Unknown
'; +insertFooter(); + + + +//----------------------------------------------------------------------------- +// 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 nodelist.status. +function getGroupStatus() { + $groups = array(); + $xml = docmd('tabdump','',array('nodelist')); + $output = $xml->xcatresponse->children(); + #$output = $xml->children(); // technically, we should iterate over the xcatresponses, because there can be more than one + foreach ($output as $line) { + //echo "

line=$line

"; + $vals = array(); + preg_match('/^"([^"]*)","([^"]*)",(.*)$/', $line, $vals); //todo: create function to parse tabdump output better + if (count($vals) > 3) { + //$node = $vals[1]; + $grplist = preg_split('/,/', $vals[2]); + $rest = $vals[3]; + $status = array(); + preg_match('/^"([^"]*)"/', $rest, $status); + if (count($status) < 2) { $status[1] = 'unknown'; } + foreach ($grplist as $g) { + if (array_key_exists($g,$groups)) { $groups[$g] = minstat($groups[$g], $status[1]); } + else { $groups[$g] = $status[1]; } + } + } + } + return $groups; +} + + +//----------------------------------------------------------------------------- +// For 2 status strings from nodestat or nodelist.status, return the "lowest". +function minstat($s1, $s2) { + $statnum = array( 'unknown' => 0, + 'noping' => 1, + 'ping' => 2, + 'snmp' => 3, + 'sshd' => 4, + 'pbs' => 5, + 'ready' => 6, + ); + + // if either value is empty, just return the other one + if (!isset($s1)) { return $s2; } + if (!isset($s2)) { return $s1; } + + // if either value does not map into the hash, then return unknown + if (!isset($statnum[$s1]) || !isset($statnum[$s2])) { return 'unknown'; } + + if ($statnum[$s1] < $statnum[$s2]) { return $s1; } + else { return $s2; } +} + + ?> \ No newline at end of file diff --git a/xCAT-web/machines/nodes_by_group.php b/xCAT-web/machines/nodes_by_group.php index be561565b..027bda3c1 100644 --- a/xCAT-web/machines/nodes_by_group.php +++ b/xCAT-web/machines/nodes_by_group.php @@ -1,11 +1,17 @@ diff --git a/xCAT-web/machines/test.css b/xCAT-web/machines/test.css new file mode 100644 index 000000000..c58705b1f --- /dev/null +++ b/xCAT-web/machines/test.css @@ -0,0 +1,21 @@ + +#disclaimer { + font-weight: bold; + font-size: 9pt; + color: red; + text-align: center; + margin: 5px; +} + +.GroupNodeTable { margin-left: 10px; } + +.myTableHeader { + color: black; + background-color: #FFFF66; +} + +.myTableRow { + color: black; + background-color: #FFFF66; +} + diff --git a/xCAT-web/manage/dsh.php b/xCAT-web/manage/dsh.php index 41e9704da..76b93800c 100644 --- a/xCAT-web/manage/dsh.php +++ b/xCAT-web/manage/dsh.php @@ -71,7 +71,7 @@ if (!isset($_REQUEST['noderange'])) { to /tmp on the nodes and executed from there.) - + Use parallel shell (psh) command instead of xdsh. Currently this option must be used, and the options below (associated with xdsh) are disabled. @@ -79,17 +79,17 @@ if (!isset($_REQUEST['noderange'])) { - Streaming mode + Streaming mode Specifies that output is returned as it becomes available from each target, instead of waiting for the command to be completed on a target before returning output from that target. - Monitor + Monitor Prints starting and completion messages for each node. Useful with Streaming mode. - Verify + Verify Verifies that nodes are responding before sending the command to them. @@ -99,12 +99,12 @@ if (!isset($_REQUEST['noderange'])) { - Fanout: + Fanout: The maximum number of nodes the command should be run on concurrently. When the command finishes on 1 of the nodes, it will be started on an additional node (the default is 64). - UserID: + UserID: The user id to use to run the command on the nodes. @@ -119,13 +119,13 @@ if (!isset($_REQUEST['noderange'])) { - Return Code + Return Code Prints the return code of the (last) command that was run remotely on each node. The return code is appended at the end of the output for each node. Tips:
    -
  • See the xdsh man page for more information about this command.
  • +
  • See the xdsh man page for more information about this command.
diff --git a/xCAT-web/manage/dsh_action.php b/xCAT-web/manage/dsh_action.php index 58ab62e52..bb836cbce 100644 --- a/xCAT-web/manage/dsh_action.php +++ b/xCAT-web/manage/dsh_action.php @@ -46,81 +46,54 @@ if (isset($_COOKIE['history']) && array_search($_REQUEST['command'], $_COOKIE['h $ret_code = @$_REQUEST["ret_code"]; - //if ($group == "") $nodegrps = "blade7"; // For now, use blade7 as test node + if (!empty($group)) $noderange = $group; + else $noderange = $node; - if ($psh == "off"){ //using dsh - $command = "xdsh "; - $copy_cmd = "xdcp "; - if ($group == "") $node_group = /* "-n " . */ $node; - else $node_group = /* "-N " . */ $group; + if ($serial == "on") $args[] = "-s"; //streaming mode + if (!empty($fanout)) { $args[] = "-f"; $args[] = $fanout; } + if (!empty($userID)) { $args[] = "-l"; $args[] = $userID; } + if ($verify == "on") $args[] = "-v"; + if ($monitor == "on") $args[] = "-m"; + if ($copy == "on") $args[] = "-e"; + if ($ret_code == "on") $args[] = "-z"; - }else{ - $command = "psh "; - $copy_cmd = "pscp "; - if ($group == "") $node_group = $node; - else $node_group = $group; - } + //$exp_cmd = "export DSH_CONTEXT=XCAT XCATROOT=/opt/xcat; "; - if ($serial == "on") $options = "-s "; //serial mode/streaming mode - if ($fanout == "") $options .= "-f 64 "; else $options .= "-f " . $fanout; - if ($userID != "") $options .= "-l " . $userID; - if ($verify == "on") $options .= "-v "; - if ($monitor == "on") $options .= "-m "; +/* + if ($copy == "on"){ //using dcp/prcp - //echo "

Command: ". $cmd ."

"; - - //$exp_cmd = "export DSH_CONTEXT=XCAT XCATROOT=/opt/xcat; "; - - if ($copy == "on"){ //using dcp/prcp - - //extract the script name from the command - $script = strtok($cmd,' '); - - //copy the command to the remote node - $source = "/opt/xcat/bin/" . $script; //copy from - $target = "/tmp"; //copy to - if ($psh == "off"){ - $copy_cmd = $exp_cmd . $copy_cmd . $node_group . " " . $source . " " . $target; - }else{ - $copy_cmd = $copy_cmd . $source . " " . $node_group . ":" . $target; - } - runcmd($copy_cmd,1, $outp); - - if ($psh != "on"){ - $command_string = $exp_cmd . $command. $node_group . " /tmp/" . $cmd; - }else{ - $command_string = $command . $node_group . " /tmp/" . $cmd; - } - - } - else{ - if ($psh != "on"){ - $command_string = $exp_cmd . $command. $node_group . " " . $cmd; - }else{ - $command_string = $command . $node_group . " " . $cmd; - } - } - - if ($collapse == "on") $command_string .= " | dshbak -c"; - - echo "

Command: $command_string

"; - //echo "

Command Ouput:

"; //output will be returned from the runcmd function call - - //run the script - $output = array(); - if ($ret_code == "on"){ - $rc = runcmd($command_string, 0, $output); //mode 0 - if ($rc == 0){ - foreach ($output as $line){ echo "$line
"; } - } + //extract the script name from the command + $script = strtok($cmd,' '); + //copy the command to the remote node + $source = $script; + $target = "/tmp"; + if (empty($psh) || $psh!="on"){ + $xml = docmd('xdcp',$noderange,array($source, $target)); + //todo: check if copy succeeded }else{ - //$rc = runcmd($command_string,1, $outp); //streaming mode - DOES NOT WORK YET - $rc = runcmd($command_string, 0, $output); //mode 0 - if ($rc == 0){ - foreach ($output as $line){ echo "$line
"; } - } + runcmd("pscp $source $noderange:$target",1,$outp); } + $cmd = "/tmp/$cmd"; + } +*/ + + if (empty($psh) || $psh!="on") $command = "xdsh"; + else $command = "psh"; + + //if ($collapse == "on") $command_string .= " | dshbak -c"; + + // Run the script + $args[] = $cmd; + echo "

Command: $command $noderange " . implode(' ',$args) . "

"; + //echo "

Command Ouput:

"; //output will be returned from the runcmd function call + //$rc = runcmd($command_string,1, $outp); //streaming mode - DOES NOT WORK YET + $xml = docmd($command, $noderange, $args); + //echo "

count=" . count($xml) . ", children=" . $xml->children() . "

"; + //echo "

"; print_r($xml); echo "

"; + //$output = $xml->xcatresponse->children(); + //echo "

"; print_r($output); echo "

"; + foreach ($xml->children() as $response) foreach ($response->children() as $line) { echo "$line
"; } diff --git a/xCAT-web/xCAT-web.spec b/xCAT-web/xCAT-web.spec index c9d414a87..1721ad605 100644 --- a/xCAT-web/xCAT-web.spec +++ b/xCAT-web/xCAT-web.spec @@ -52,10 +52,10 @@ then apachedaemon='httpd' apacheuser='apache' - # todo: change this when switch to xcat 2 - echo "Updating apache userid to allow logins..." - cp /etc/passwd /etc/passwd.orig - perl -e 'while (<>) { s,^apache:(.*):/sbin/nologin$,apache:$1:/bin/bash,; print $_; }' /etc/passwd.orig >/etc/passwd + # Note: this was for sudo with xcat 1.3 + #echo "Updating apache userid to allow logins..." + #cp /etc/passwd /etc/passwd.orig + #perl -e 'while (<>) { s,^apache:(.*):/sbin/nologin$,apache:$1:/bin/bash,; print $_; }' /etc/passwd.orig >/etc/passwd else # SuSE apachedaemon='apache2' apacheuser='wwwrun' @@ -67,19 +67,20 @@ then /bin/ln -s %{prefix}/web/etc/apache2/conf.d/xcat-web.conf /etc/$apachedaemon/conf.d/xcat-web.conf /etc/init.d/$apachedaemon reload - # Link to the grpattr cmd. Todo: remove this when it is in base xcat - /bin/rm -f %{prefix}/bin/grpattr - mkdir -p %{prefix}/bin - /bin/ln -s %{prefix}/web/cmds/grpattr %{prefix}/bin/grpattr + # Link to the grpattr cmd. Note: this was for xcat 1.3. Do not use this anymore. + #/bin/rm -f %{prefix}/bin/grpattr + #mkdir -p %{prefix}/bin + #/bin/ln -s %{prefix}/web/cmds/grpattr %{prefix}/bin/grpattr + + # Config sudo. Note: this was for xcat 1.3. Do not use this anymore. + #if ! egrep -q "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then + #echo "Configuring sudo for $apacheuser..." + #echo "$apacheuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + #fi - # Config sudo. Todo: change this when switch to xcat 2 - if ! egrep -q "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then - echo "Configuring sudo for $apacheuser..." - echo "$apacheuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - fi # Authorize the apacheuser to xcatd - # echo -e "y\ny\ny" | %{prefix}/share/xcat/scripts/setup-local-client.sh $apacheuser - # XCATROOT=%{prefix} %{prefix}/sbin/chtab priority=5 policy.name=$apacheuser policy.rule=allow + echo -e "y\ny\ny" | %{prefix}/share/xcat/scripts/setup-local-client.sh $apacheuser + XCATROOT=%{prefix} %{prefix}/sbin/chtab priority=5 policy.name=$apacheuser policy.rule=allow fi @@ -98,9 +99,9 @@ then apacheuser='apache' # Undo change we made to passwd file. Todo: change this when switch to xcat 2 - echo "Undoing apache userid login..." - cp /etc/passwd /etc/passwd.tmp - perl -e 'while (<>) { s,^apache:(.*):/bin/bash$,apache:$1:/sbin/nologin,; print $_; }' /etc/passwd.tmp >/etc/passwd + #echo "Undoing apache userid login..." + #cp /etc/passwd /etc/passwd.tmp + #perl -e 'while (<>) { s,^apache:(.*):/bin/bash$,apache:$1:/sbin/nologin,; print $_; }' /etc/passwd.tmp >/etc/passwd else # SuSE apachedaemon='apache2' apacheuser='wwwrun' @@ -110,15 +111,15 @@ then echo "Undoing $apachedaemon configuration for xCAT..." /bin/rm -f /etc/$apachedaemon/conf.d/xcat-web.conf /etc/init.d/$apachedaemon reload - /bin/rm -f %{prefix}/bin/grpattr + #/bin/rm -f %{prefix}/bin/grpattr # Remove change we made to sudoers config. Todo: remove this when switch to xcat 2 - if egrep -q "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then - echo "Undoing sudo configuration for $apacheuser..." - cp -f /etc/sudoers /etc/sudoers.tmp - egrep -v "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers.tmp > /etc/sudoers - rm -f /etc/sudoers.tmp - fi + #if egrep -q "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers; then + #echo "Undoing sudo configuration for $apacheuser..." + #cp -f /etc/sudoers /etc/sudoers.tmp + #egrep -v "^$apacheuser ALL=\(ALL\) NOPASSWD:ALL" /etc/sudoers.tmp > /etc/sudoers + #rm -f /etc/sudoers.tmp + #fi fi