2007-10-26 22:44:33 +00:00
|
|
|
<?php
|
|
|
|
/*------------------------------------------------------------------------------
|
2007-10-30 13:05:36 +00:00
|
|
|
Produce the page for running commands on the nodes of the cluster
|
2007-10-26 22:44:33 +00:00
|
|
|
------------------------------------------------------------------------------*/
|
2007-11-27 16:00:27 +00:00
|
|
|
$TOPDIR = '..';
|
2007-10-26 22:44:33 +00:00
|
|
|
$expire_time = gmmktime(0, 0, 0, 1, 1, 2038);
|
2007-12-11 19:44:21 +00:00
|
|
|
//setcookie('history[]', "date;hello.sh", $expire_time);
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-11-27 16:00:27 +00:00
|
|
|
require_once "$TOPDIR/lib/functions.php";
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-10-23 17:54:02 +00:00
|
|
|
insertHeader('Run Commands on Nodes', array('dsh.css'),
|
|
|
|
array('dsh.js'),
|
2007-12-11 19:44:21 +00:00
|
|
|
array('manage','dsh'));
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:44:21 +00:00
|
|
|
echo <<<EOS
|
2007-10-30 13:05:36 +00:00
|
|
|
<div id=content>
|
2008-10-23 17:54:02 +00:00
|
|
|
<FORM NAME=dshForm>
|
|
|
|
<TABLE id=inner_table cellspacing=0 cellpadding=5>
|
2007-10-26 22:44:33 +00:00
|
|
|
<TBODY>
|
2007-12-11 19:44:21 +00:00
|
|
|
<TR><TD colspan=3>
|
|
|
|
EOS;
|
|
|
|
|
|
|
|
if (isset($_REQUEST['noderange'])) {
|
|
|
|
echo "<B><FONT size='+1'>Run Command on: </FONT></B>";
|
|
|
|
if (strlen($_REQUEST['noderange']) > 70) {
|
2008-10-23 17:54:02 +00:00
|
|
|
echo "<TEXTAREA rows=1 cols=70 readonly name=nodeList id=nodeList>" . $_REQUEST['noderange'] . "</TEXTAREA>\n";
|
2007-12-11 19:44:21 +00:00
|
|
|
} else {
|
2008-10-23 17:54:02 +00:00
|
|
|
echo "<INPUT size=70 type=text name=nodeList id=nodeList value='" . $_REQUEST['noderange'] . "'>\n";
|
2007-12-11 19:44:21 +00:00
|
|
|
}
|
|
|
|
} else { echo "<B><FONT size='+1'>Run Command on a Group of Nodes</FONT></B>\n"; }
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:44:21 +00:00
|
|
|
echo <<<EOS2
|
|
|
|
</TD></TR>
|
|
|
|
<TR><TD colspan=3>
|
2007-12-04 18:17:21 +00:00
|
|
|
<P>Select a previous command from the history, or enter the command and options below. Then click on Run Cmd.</P>
|
2007-12-11 19:44:21 +00:00
|
|
|
</TD></TR>
|
|
|
|
<TR><TD colspan=3>
|
|
|
|
EOS2;
|
2008-10-23 17:54:02 +00:00
|
|
|
insertButtons(array('label' => 'Run Cmd', 'id' => 'runcmdButton', 'onclick' => 'opencmddialog()'));
|
2007-12-11 19:44:21 +00:00
|
|
|
echo "</TD></TR>\n";
|
|
|
|
|
|
|
|
if (!isset($_REQUEST['noderange'])) {
|
2008-10-23 17:54:02 +00:00
|
|
|
echo "<TR class=FormTable><TD colspan=3>Run Command on Group:<SELECT name=nodegrps id=nodegrps><OPTION value=''>Choose ...</OPTION>\n";
|
2007-12-11 19:44:21 +00:00
|
|
|
$nodegroups = getGroups();
|
|
|
|
foreach ($nodegroups as $group) {
|
|
|
|
//if($group == $currentGroup) { $selected = 'selected'; } else { $selected = ''; }
|
|
|
|
echo "<OPTION value='$group' $selected>$group</OPTION>\n";
|
|
|
|
}
|
|
|
|
echo "</SELECT></td></tr>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD colspan=3>Command:
|
2008-10-23 17:54:02 +00:00
|
|
|
<INPUT size=80 type=text name=command id=command>
|
2007-12-11 19:44:21 +00:00
|
|
|
History:
|
2008-10-23 17:54:02 +00:00
|
|
|
<SELECT name=history onChange="_setvars();">
|
2007-10-26 22:44:33 +00:00
|
|
|
<OPTION value="">Choose ...</OPTION>
|
|
|
|
<?php
|
2007-12-11 19:44:21 +00:00
|
|
|
if (isset($_COOKIE['history'])) {
|
|
|
|
foreach ($_COOKIE['history'] as $value) { echo "<option value='$value'>$value</option>\n"; }
|
2007-10-26 22:44:33 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</SELECT>
|
2007-12-11 19:44:21 +00:00
|
|
|
</TD>
|
2007-10-26 22:44:33 +00:00
|
|
|
</TR>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TR class=FormTable>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD colspan=3><INPUT type=checkbox name=copy_script id=copy_script>
|
|
|
|
Copy command to nodes (The command specified above will 1st be copied
|
2007-10-26 22:44:33 +00:00
|
|
|
to /tmp on the nodes and executed from there.)</TD>
|
|
|
|
</TR>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TR class=FormTable>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD colspan=3><INPUT type=checkbox name=run_psh id=run_psh disabled>
|
|
|
|
Use parallel shell (psh) command instead of xdsh. When this option is chosen, some of the options below (associated with xdsh) are disabled.</TD>
|
2007-10-26 22:44:33 +00:00
|
|
|
</TR>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TR class=FormTable>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD colspan=3><B>Options:</TD>
|
2007-10-26 22:44:33 +00:00
|
|
|
</TR>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TR class=FormTable>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD width=37></TD>
|
|
|
|
<TD valign=top nowrap><INPUT type=checkbox name=serial id=serial>Streaming mode</TD>
|
|
|
|
<TD>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.</TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap><INPUT type=checkbox name=monitor id=monitor>Monitor</TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>Prints starting and completion messages for each node. Useful with Streaming mode.</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap><INPUT type=checkbox name=verify id=verify>Verify</TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>Verifies that nodes are responding before sending the command to them.</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap><INPUT type=checkbox name=collapse id=collapse disabled>Collaspe Identical Output</TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>Automatically pipe the xdsh output into xdshbak which will only display output once for all the nodes that display identical output. See the xdshbak man page for more info.</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap>Fanout: <INPUT type=text name=fanout id=fanout></TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>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).</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap>UserID: <INPUT type=text name=userID id=userID></TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>The user id to use to run the command on the nodes.</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap>Remote Shell: <INPUT type=text name=rshell id=rshell></TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>The remote shell program to use to run the command on the nodes. The default is /usr/bin/ssh.</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap>Shell Options: <INPUT type=text name=shell_opt id=shell_opt></TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>Options to pass to the remote shell being used.</TD>
|
|
|
|
</TR>
|
|
|
|
<TR class=FormTable>
|
|
|
|
<TD></TD>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TD valign=top nowrap><INPUT type=checkbox name=ret_code id=ret_code>Return Code</TD>
|
2007-12-04 18:17:21 +00:00
|
|
|
<TD>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.</TD>
|
2007-10-26 22:44:33 +00:00
|
|
|
</TR>
|
2008-10-23 17:54:02 +00:00
|
|
|
<TR><TD colspan=3>
|
|
|
|
<font class=BlueBack>Tips:</font>
|
2007-10-26 22:44:33 +00:00
|
|
|
<UL>
|
2008-09-26 20:25:53 +00:00
|
|
|
<LI>See the <A href="<?php echo getDocURL('manpage','xdsh.1'); ?>">xdsh man page</A> for more information about this command.</LI>
|
2007-10-26 22:44:33 +00:00
|
|
|
</UL>
|
|
|
|
</TD></TR>
|
|
|
|
</TBODY>
|
|
|
|
</TABLE>
|
|
|
|
</FORM>
|
2007-10-30 13:05:36 +00:00
|
|
|
<div>
|
2007-10-26 22:44:33 +00:00
|
|
|
</BODY>
|
|
|
|
</HTML>
|