xcat-core/xCAT-UI/monitor/monlist.php
mxi1 dfd6267aa5 1) the new directory "monitor" is added to support monitoring features;
2) the file "monlist.php" is used to list all the avaiable plug-ins; 

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3811 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2009-07-16 09:54:58 +00:00

70 lines
2.1 KiB
PHP

<?php
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/display.php";
#displayMonitorLists() will generate all the monitoring plug-ins,
#the user can select the plug-ins he wants to operate on,
#and press the "Next" button;
function displayMonitorLists() {
#The command "monls -a" is used to get the monitoring plug-ins list
$xml = docmd("monls"," ", array('-a'));
if(getXmlErrors($xml,$errors)) {
echo "<p class=Error>",implode(' ', $errors), "</p>";
exit;
}
#then, parse the xml data
foreach($xml->children() as $response) foreach($response->children() as $data) {
list($name, $stat) = preg_split("/\s+/", $data);
echo <<<TAB1
<tr>
<td><input type='checkbox' /><a href="monitor/plugin_desc.php?name=$name">$name</a></td>
<td>$stat</td>
<td></td>
</tr>
TAB1;
//echo "<tr><td><input type='checkbox' />$name</td><td>$stat</td><td><a onclick='LoadMainPage("main.php")'>$name</a></td></tr>";
}
return 0;
}
?>
<script type="text/javascript">
$(function() {
$("#head").css("background-color", "rgb(141, 189, 216)");
// var dialogOpts = {
// hide: true
// }
// $("#description").dialog(dialogOpts);
});
</script>
<div class='mapper'>
<span>
<a href='#' onclick='loadMainPage("main.php")'>home</a> /
<a href='#' onclick='loadMainPage("monitor/monlist.php")'>Plug-ins' List</a>
</span>
</div>
<div>
<h3>Tips:</h3>
<p>Please select the available plug-ins, and click the "next" button for next steps;</p>
</div>
<div>
<table align="center">
<thead id="head">
<tr>
<th>Plug-in Name</th>
<th>Status</th>
<th>Node Status Monitoring</th>
</tr>
</thead>
<tbody id="monlist" align="left">
<?php displayMonitorLists();?>
</tbody>
</table>
</div>
<div id="description"></div>
<?php insertButtons(array('label'=>'NEXT', 'id'=>'next', 'onclick'=>'loadMainPage("main.php")')); ?>