2009-07-29 06:07:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function displayTips($tips)
|
|
|
|
{
|
|
|
|
//to tell the user how to operate on the current web page
|
|
|
|
//the argument $tips is an array like this:
|
|
|
|
//{
|
|
|
|
// "Click the name of each plugin, you can get the plugin's description.",
|
|
|
|
// "You can also select one plugin, then you can set node/application status monitoring for the selected plugin.",
|
|
|
|
//}
|
2009-09-03 07:23:32 +00:00
|
|
|
echo '<div class="tips">';
|
|
|
|
echo '<p class="tips_head"><b>Tips:</b>(Click me to display tips)</p>';
|
|
|
|
echo '<div class="tips_content">';
|
2009-07-29 06:07:58 +00:00
|
|
|
foreach ($tips as $tip) {
|
2009-08-13 06:45:39 +00:00
|
|
|
echo "<p>$tip</p>";
|
2009-07-29 06:07:58 +00:00
|
|
|
echo "\n";
|
|
|
|
}
|
2009-09-03 07:23:32 +00:00
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
echo '<script type="text/javascript">';
|
|
|
|
echo '$(handle_tips());';
|
|
|
|
echo '</script>';
|
2009-08-05 16:23:52 +00:00
|
|
|
echo '</div>';
|
2009-07-29 06:07:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-08-18 03:11:36 +00:00
|
|
|
function insertDiv($id)
|
2009-07-29 06:07:58 +00:00
|
|
|
{
|
2009-08-18 03:11:36 +00:00
|
|
|
echo "<div id=$id></div>";
|
2009-07-29 06:07:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function displayMonTable()
|
|
|
|
{
|
|
|
|
//create one table to display the monitoring plugins' list
|
2009-08-05 16:23:52 +00:00
|
|
|
echo '<div id="monlist_table">';
|
2009-07-29 06:07:58 +00:00
|
|
|
echo <<<TOS1
|
|
|
|
<table id="tabTable" class="tabTable" cellspacing="1">
|
|
|
|
<thead>
|
|
|
|
<tr class="colHeaders">
|
2009-11-05 06:50:40 +00:00
|
|
|
<td><b>Plug-in Name</b></td>
|
|
|
|
<td><b>Status</b></td>
|
|
|
|
<td><b>Node Status Monitoring</b></td>
|
|
|
|
<td><b>Configure</b></td>
|
|
|
|
<td><b>Action</b></td>
|
2009-07-29 06:07:58 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
TOS1;
|
2009-08-19 09:12:58 +00:00
|
|
|
echo <<<TOS9
|
|
|
|
<script type="text/javascript">
|
2009-11-05 06:50:40 +00:00
|
|
|
hoverOnMonlist();
|
2009-08-19 09:12:58 +00:00
|
|
|
</script>
|
|
|
|
TOS9;
|
2009-07-29 06:07:58 +00:00
|
|
|
echo '<tbody id="monlist">';
|
|
|
|
displayMonitorLists();
|
|
|
|
echo "</tbody></table></div>";
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-07-29 11:30:44 +00:00
|
|
|
|
2009-07-29 06:07:58 +00:00
|
|
|
function displayStatus()
|
|
|
|
{
|
|
|
|
//tell the user that the current interface is not done yet...
|
2009-08-13 06:45:39 +00:00
|
|
|
echo "<div id='devstatus'><p>This interface is still under development -use accordingly.</p></div>";
|
2009-07-29 06:07:58 +00:00
|
|
|
}
|
2009-08-05 16:23:52 +00:00
|
|
|
|
|
|
|
function displayOSITree()
|
|
|
|
{
|
|
|
|
//display the node range tree, but only with the nodes with OSI type
|
2009-11-26 07:31:17 +00:00
|
|
|
//this follows the function showNrTreeInput();
|
2009-12-07 09:42:14 +00:00
|
|
|
echo "<div id=nrtree-input class='ui-corner-all'>";
|
2009-11-26 07:31:17 +00:00
|
|
|
echo <<<TOS3
|
2009-08-05 16:23:52 +00:00
|
|
|
<script type="text/javascript">
|
2009-11-26 07:31:17 +00:00
|
|
|
$(function() {
|
|
|
|
nrtree = new tree_component(); // -Tree begin
|
|
|
|
nrtree.init($("#nrtree-input"),{
|
|
|
|
rules: { multiple: "Ctrl" },
|
|
|
|
ui: { animation: 250 },
|
|
|
|
callback : { onchange : printtree },
|
|
|
|
data : {
|
|
|
|
type : "json",
|
|
|
|
async : "true",
|
|
|
|
url: "noderangesource.php"
|
|
|
|
}
|
|
|
|
}); //Tree finish
|
|
|
|
});
|
2009-08-05 16:23:52 +00:00
|
|
|
</script>
|
2009-11-26 07:31:17 +00:00
|
|
|
TOS3;
|
|
|
|
echo "</div>";
|
2009-08-05 16:23:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function displayAssociation()
|
|
|
|
{
|
2009-11-26 07:31:17 +00:00
|
|
|
//TODO: the return message of "webrun lscondresp" is changed
|
|
|
|
//and, also, DataTables is used to draw the tabls
|
|
|
|
echo '<div id="association" class="ui-cornel-all">';
|
2009-08-05 16:23:52 +00:00
|
|
|
echo <<<TOS5
|
2009-11-26 07:31:17 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$("#association").dataTable({
|
|
|
|
"bLengthChange": false,
|
|
|
|
"bFilter": true,
|
2010-01-13 05:14:00 +00:00
|
|
|
"bSort": true,
|
|
|
|
"iDisplayLength": 50
|
2009-11-26 07:31:17 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<table>
|
2009-08-05 16:23:52 +00:00
|
|
|
<thead>
|
2009-11-26 07:31:17 +00:00
|
|
|
<tr>
|
|
|
|
<th>Condition</td>
|
|
|
|
<th>Response</td>
|
|
|
|
<th>Node</td>
|
|
|
|
<th>State</td>
|
|
|
|
<th>Action</td>
|
2009-08-05 16:23:52 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2009-08-13 06:45:39 +00:00
|
|
|
<tbody>
|
2009-08-05 16:23:52 +00:00
|
|
|
TOS5;
|
2009-08-13 06:45:39 +00:00
|
|
|
$xml = docmd("webrun", "", array("lscondresp"));
|
|
|
|
if(getXmlErrors($xml,$errors)) {
|
|
|
|
echo "<p class=Error>",implode(' ', $errors), "</p>";
|
|
|
|
exit;
|
|
|
|
}
|
2009-08-05 16:23:52 +00:00
|
|
|
//get all the condition&response associations for RMC
|
2009-08-13 06:45:39 +00:00
|
|
|
foreach ($xml->children() as $response) foreach($response->children() as $data) {
|
|
|
|
//get the data from xcatd
|
2009-11-26 07:31:17 +00:00
|
|
|
$record = split('"',$data);
|
|
|
|
echo "<tr>";
|
|
|
|
echo <<<TOS6
|
|
|
|
<td>$record[1]</td>
|
|
|
|
<td>$record[3]</td>
|
|
|
|
<td>$record[5]</td>
|
|
|
|
<td>$record[7]</td>
|
|
|
|
TOS6;
|
|
|
|
//TODO: insert the button here
|
2009-12-07 09:42:14 +00:00
|
|
|
echo "<td>";
|
|
|
|
if($record[7] == "Active") {
|
2009-12-11 02:58:43 +00:00
|
|
|
echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"stop\")'>Disable</button>";
|
2009-12-07 09:42:14 +00:00
|
|
|
}else {
|
2009-12-11 02:58:43 +00:00
|
|
|
echo "<button class='fg-button ui-corner-all ui-state-active' onclick='control_RMCAssoc(\"$record[1]\", \"$record[5]\", \"$record[3]\", \"start\")'>Enable</button>";
|
2009-12-07 09:42:14 +00:00
|
|
|
}
|
|
|
|
echo "</td>";
|
2009-11-26 07:31:17 +00:00
|
|
|
echo "</tr>";
|
2009-08-13 06:45:39 +00:00
|
|
|
}
|
|
|
|
echo "</tbody></table></div>";
|
2009-08-05 16:23:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-08-13 06:45:39 +00:00
|
|
|
function displayCond()
|
2009-08-05 16:23:52 +00:00
|
|
|
{
|
2009-11-26 07:31:17 +00:00
|
|
|
//display all the avaiable conditions to a <table> element
|
2009-08-13 06:45:39 +00:00
|
|
|
echo <<<COND
|
2009-12-07 09:42:14 +00:00
|
|
|
<div id="avail_cond" style="display:none">
|
2009-11-26 07:31:17 +00:00
|
|
|
<table>
|
2009-08-13 06:45:39 +00:00
|
|
|
<thead>
|
|
|
|
<tr class="colHeaders">
|
2009-11-26 07:31:17 +00:00
|
|
|
<th></td>
|
|
|
|
<th>Conditions</td>
|
2009-08-13 06:45:39 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
COND;
|
|
|
|
$xml = docmd("webrun", '', array("lscondition"));
|
|
|
|
foreach($xml->children() as $response) foreach($response->children() as $data) {
|
2009-11-26 07:31:17 +00:00
|
|
|
/*
|
|
|
|
* the data format like this
|
|
|
|
* "HFI_not_configured" "ca4lpar02" "Not monitored"
|
|
|
|
* "Drawer_not_configured" "ca4lpar02" "Not monitored"
|
|
|
|
* "AnyNodeFileSystemSpaceUsed_H" "ca4lpar02" "Not monitored"
|
|
|
|
*/
|
|
|
|
$tmp = split('"', $data);
|
|
|
|
//$tmp[1] = condition name
|
|
|
|
//$tmp[3] = nodename
|
|
|
|
//$tmp[5] = status
|
|
|
|
echo <<<TOS99
|
|
|
|
<tr>
|
|
|
|
<td><input type='radio' name='conditions' value='$tmp[1]]' /></td>
|
|
|
|
<td>$tmp[1]</td>
|
|
|
|
</tr>
|
|
|
|
TOS99;
|
2009-08-13 06:45:39 +00:00
|
|
|
}
|
2009-12-07 09:42:14 +00:00
|
|
|
|
2009-08-13 06:45:39 +00:00
|
|
|
echo "</tbody></table></div>";
|
2009-08-05 16:23:52 +00:00
|
|
|
return 0;
|
2009-08-13 06:45:39 +00:00
|
|
|
|
2009-08-05 16:23:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function displayResp()
|
|
|
|
{
|
2009-08-13 06:45:39 +00:00
|
|
|
echo <<<RESP
|
2009-12-07 09:42:14 +00:00
|
|
|
<div id="avail_resp" style="display:none">
|
|
|
|
<table>
|
2009-08-13 06:45:39 +00:00
|
|
|
<thead>
|
|
|
|
<tr class="colHeaders">
|
2009-12-07 09:42:14 +00:00
|
|
|
<th></td>
|
|
|
|
<th>Response</td>
|
2009-08-13 06:45:39 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
RESP;
|
|
|
|
$xml=docmd("webrun", '', array("lsresponse"));
|
|
|
|
$ooe=0;
|
|
|
|
$line=0;
|
|
|
|
foreach($xml->children() as $response) foreach($response->children() as $data) {
|
2009-11-26 07:31:17 +00:00
|
|
|
$record = split('"', $data);
|
|
|
|
echo "<tr>";
|
|
|
|
echo <<<TOS7
|
|
|
|
<td><input type='checkbox' name='responses' value='$record[1]]' /></td>
|
|
|
|
<td>$record[1]</td>
|
|
|
|
TOS7;
|
2009-08-13 06:45:39 +00:00
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
echo '</tbody></table></div>';
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function displayCondResp()
|
|
|
|
{
|
|
|
|
echo '<div id="condresp">';
|
2009-12-07 09:42:14 +00:00
|
|
|
echo <<<JS00
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$("#nrtree-input").hide();
|
|
|
|
$("#showOpt4association").click(function() {
|
|
|
|
if($("#avail_cond").css("display") == "none") {
|
|
|
|
$("#nrtree-input").show();
|
|
|
|
$("#assobuttonsets").show();
|
|
|
|
$("#avail_cond").show();
|
|
|
|
$("#avail_resp").show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#addAssociation").click(function() {
|
|
|
|
mkCondResp();
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#cancelAssociation").click(function() {
|
|
|
|
clearEventDisplay();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
JS00;
|
|
|
|
echo "<div style='display:block'>";
|
2009-08-13 06:45:39 +00:00
|
|
|
displayAssociation();
|
2009-12-07 09:42:14 +00:00
|
|
|
echo "</div>";
|
|
|
|
echo "<div id='showOpt4association' style='display:block; border:1px solid lime;' class='ui-state-active'>";
|
|
|
|
echo <<<TOS00
|
|
|
|
<span class="ui-icon ui-icon-triangle-1-e" style="position:absolute"></span>
|
2009-12-11 02:58:43 +00:00
|
|
|
<p class='ui-state-active'>Click here if you want to create new associations...</p>
|
2009-12-07 09:42:14 +00:00
|
|
|
TOS00;
|
|
|
|
echo "</div>";
|
|
|
|
echo "<div id=notify_me></div>";
|
|
|
|
echo "<div style='display:block'>";
|
|
|
|
displayOSITree();
|
|
|
|
echo "<div style='border: 1px dotted orange; float:right; width:73%'>";
|
|
|
|
echo <<<BTN00
|
|
|
|
<div id="assobuttonsets" style="display:none">
|
2009-12-11 02:58:43 +00:00
|
|
|
<button id="addAssociation" class="fg-button ui-corner-all ui-state-active">Apply</button>
|
|
|
|
<button id="cancelAssociation" class="fg-button ui-corner-all ui-state-active">Cancel</button>
|
2009-12-07 09:42:14 +00:00
|
|
|
</div>
|
|
|
|
BTN00;
|
|
|
|
echo "<div>";
|
2009-08-13 06:45:39 +00:00
|
|
|
displayCond();
|
|
|
|
displayResp();
|
2009-12-07 09:42:14 +00:00
|
|
|
echo "</div>";
|
|
|
|
echo "</div>";
|
|
|
|
echo "</div>";
|
2009-08-05 16:23:52 +00:00
|
|
|
echo '</div>';
|
2009-08-13 06:45:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function displayRMCRsrc()
|
|
|
|
{
|
|
|
|
echo <<<TOS0
|
|
|
|
<b>Available RMC Resources</b>
|
|
|
|
<table id="tabTable" class="tabTable" cellspacing="1">
|
|
|
|
<thead>
|
|
|
|
<tr class="colHeaders">
|
|
|
|
<td></td>
|
|
|
|
<td>Class Name</td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
TOS0;
|
|
|
|
$xml = docmd("webrun", "", array("lsrsrc"));
|
|
|
|
if(getXmlErrors($xml,$errors)) {
|
|
|
|
echo "<p class=Error>",implode(' ', $errors), "</p>";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
foreach($xml->children() as $response) foreach($response->children() as $data) {
|
|
|
|
//get all the class name
|
|
|
|
$classes = explode("=", $data);
|
|
|
|
}
|
|
|
|
$ooe = 0;
|
|
|
|
$line = 0;
|
|
|
|
foreach($classes as $class) {
|
|
|
|
$ooe = $ooe%2;
|
|
|
|
echo "<tr class='ListLine$ooe' id='row$line'>";
|
|
|
|
echo "<td><input type='radio' name='classGrp' value='$class' onclick='showRMCAttrib()' /> </td>";
|
|
|
|
echo "<td>$class</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
$ooe++;
|
|
|
|
$line++;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "</tbody></table>";
|
2009-08-05 16:23:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-08-13 06:45:39 +00:00
|
|
|
function displayRMCAttr()
|
|
|
|
{
|
|
|
|
echo "<p>Select the RMC Resource, you will see all its available attributes here.</p>";
|
|
|
|
}
|
|
|
|
|
2009-09-03 04:44:56 +00:00
|
|
|
|
|
|
|
function RMCEventLogToTable()
|
|
|
|
{
|
|
|
|
$xml = docmd("webrun", "", array("lsevent"));
|
|
|
|
|
|
|
|
|
|
|
|
//var_dump($xml);
|
|
|
|
foreach($xml->children() as $response) foreach($response->children() as $records)
|
|
|
|
{
|
|
|
|
//$data should be one array to store all the RMC event log.
|
|
|
|
echo "<tr>";
|
|
|
|
foreach($records->children() as $data) {
|
|
|
|
echo "<td>$data</td>";
|
|
|
|
}
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//displayRMCEventLog() to display the RMC event logs in one table with "tablesorter" class
|
|
|
|
function displayRMCEvnetLog()
|
|
|
|
{
|
2009-12-07 09:42:14 +00:00
|
|
|
echo '<div id=lseventLog>';
|
|
|
|
echo <<<TOS8
|
|
|
|
<script type="text/javascript" type"utf-8">
|
2009-12-11 02:58:43 +00:00
|
|
|
$("#lseventLog table").dataTable({
|
2010-01-13 05:14:00 +00:00
|
|
|
"bLengthChange": false,
|
|
|
|
"bFilter": false,
|
|
|
|
"bSort": true,
|
|
|
|
"iDisplayLength": 50
|
2009-12-07 09:42:14 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
TOS8;
|
2009-09-03 04:44:56 +00:00
|
|
|
echo <<<TOS9
|
2009-12-11 02:58:43 +00:00
|
|
|
<table style='width:100%'>
|
2009-09-03 04:44:56 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Category</th>
|
2009-12-11 02:58:43 +00:00
|
|
|
<th>Description</th>
|
|
|
|
<th>Time</th>
|
2009-09-03 04:44:56 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
TOS9;
|
|
|
|
RMCEventLogToTable();
|
|
|
|
echo "</tbody></table>";
|
|
|
|
echo "</div>";
|
2009-09-25 08:50:49 +00:00
|
|
|
|
2009-09-03 04:44:56 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 14:54:43 +00:00
|
|
|
function displayRMCMonshowAttr($attr, $nr) {
|
2009-09-03 04:44:56 +00:00
|
|
|
//TODO: should add one argument to support the noderange argument
|
|
|
|
echo "<div>";
|
|
|
|
echo "<table class='tablesorter' cellspacing='1'>";
|
|
|
|
echo "<thead>";
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<td>Time</td>";
|
|
|
|
echo "<td>$attr</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
echo "</thead>";
|
|
|
|
echo "<tbody>";
|
|
|
|
|
2009-09-17 14:54:43 +00:00
|
|
|
if($nr == "cluster") {
|
|
|
|
//get all the data by the command "monshow"
|
|
|
|
$xml = docmd("monshow", "", array("rmcmon", "-t", "60", "-a", "$attr"));
|
|
|
|
//the error handling is skipped
|
|
|
|
}elseif($nr == "summary") {
|
|
|
|
$xml = docmd("monshow", "", array("rmcmon", "-s", "-t", "60", "-a", "$attr"));
|
|
|
|
}else {
|
|
|
|
$xml = docmd("monshow", "", array("rmcmon", "$nr", "-t", "60", "-a", "$attr"));
|
|
|
|
}
|
|
|
|
//the formats of the data are different based on $nr
|
2009-09-03 04:44:56 +00:00
|
|
|
$index = 0;
|
|
|
|
foreach($xml->children() as $response) foreach($response->children() as $data) {
|
|
|
|
//handle the data here
|
2009-09-10 06:57:06 +00:00
|
|
|
//skip the first 2 lines
|
|
|
|
if($index++ < 2) {
|
2009-09-03 04:44:56 +00:00
|
|
|
continue;
|
|
|
|
}
|
2009-09-10 06:57:06 +00:00
|
|
|
//then, parse "date" & "value"
|
|
|
|
$arr = preg_split("/\s+/", $data);
|
|
|
|
array_pop($arr);
|
2009-10-13 11:43:39 +00:00
|
|
|
//print_r($arr);
|
|
|
|
$val = array_pop($arr);
|
|
|
|
$time = implode(" ", $arr);
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<td>$time</td>";
|
|
|
|
echo "<td>$val</td>";
|
|
|
|
echo "</tr>";
|
2009-09-10 06:57:06 +00:00
|
|
|
}
|
|
|
|
echo "</tbody>";
|
|
|
|
echo "</table>";
|
|
|
|
echo "</div>";
|
|
|
|
}
|
|
|
|
|
2009-09-17 14:54:43 +00:00
|
|
|
function displayRMCMonshowGraph($value, $nr) {
|
2009-09-10 06:57:06 +00:00
|
|
|
//display the RMC Performance Data
|
2009-09-25 08:50:49 +00:00
|
|
|
$place = $nr.$value;
|
2009-09-10 06:57:06 +00:00
|
|
|
echo <<<TOS11
|
|
|
|
<script type="text/javascript">
|
2009-09-25 08:50:49 +00:00
|
|
|
rmc_monshow_draw_by_flot("$place","$value");
|
2009-09-10 06:57:06 +00:00
|
|
|
</script>
|
2009-09-25 08:50:49 +00:00
|
|
|
<div id="$place" style="width:100%;height:240px"></div>
|
2009-09-10 06:57:06 +00:00
|
|
|
TOS11;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* function displayOptionsForPlugin($plugin)
|
|
|
|
* *****************************************
|
|
|
|
* when the user selects one plugin, the avaiable configuration options will display in <div id='monconfig'>
|
|
|
|
* TODO: for the non-rmcmon plugins, only the option "node/application status monitoring setting" is shown;
|
|
|
|
*
|
|
|
|
* the avaiable view options will also display in <div id='monview'>,
|
|
|
|
* TODO: right now, it's only implemented for rmcmon plugin.
|
|
|
|
*/
|
|
|
|
function displayOptionsForPlugin($name)
|
|
|
|
{
|
|
|
|
echo "<div id='monconfig'>";
|
|
|
|
echo "<p>Available Configurations for <b>$name</b></p>";
|
|
|
|
|
|
|
|
echo '<table id="tabTable" class="tabTable" cellspacing="1">';
|
|
|
|
echo "<tbody>";
|
|
|
|
|
|
|
|
//set up the options for the plugin with the name "$name"
|
|
|
|
if($name == "rmcmon") {
|
|
|
|
//node status monitor, RMC events, RMC resources
|
|
|
|
echo "<tr class='ListLine0' id='row0'>";
|
|
|
|
echo "<td>Node/Application Status Monitoring Setting</td>";
|
2009-09-03 04:44:56 +00:00
|
|
|
echo "<td>";
|
2009-09-10 06:57:06 +00:00
|
|
|
insertButtons(array('label'=>'Configure', 'id'=>'rmc_nodestatmon', 'onclick'=>'loadMainPage("monitor/stat_mon.php?name=rmcmon")'));
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
|
|
|
|
echo "<tr class='ListLine1' id='row1'>";
|
|
|
|
echo "<td>RMC Events Monitoring Setting</td>";
|
|
|
|
echo "<td>";
|
|
|
|
insertButtons(array('label'=>'Configure', 'id'=>'rmc_event', 'onclick'=>'loadMainPage("monitor/rmc_event_define.php")'));
|
2009-09-03 04:44:56 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
|
2009-09-10 06:57:06 +00:00
|
|
|
echo "<tr class='ListLine0' id='row2'>";
|
|
|
|
echo "<td>RMC Resource Monitoring Setting</td>";
|
|
|
|
echo "<td>";
|
|
|
|
insertButtons(array('label'=>'Configure', 'id'=>'rmc_resource', 'onclick'=>'loadMainPage("monitor/rmc_resource_define.php")'));
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
//there's only "node status monitoring" is enabled
|
|
|
|
echo "<tr class='ListLine0' id='row0'>";
|
|
|
|
echo "<td>Node/Application Status Monitoring Setting</td>";
|
|
|
|
echo "<td>";
|
|
|
|
insertButtons(array('label'=>'Configure', 'id'=>$name."_nodestatmon", 'onclick'=>"loadMainPage(\"monitor/stat_mon.php?name=$name\")"));
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
2009-09-03 04:44:56 +00:00
|
|
|
}
|
|
|
|
|
2009-09-10 06:57:06 +00:00
|
|
|
echo "</tbody></table>";
|
|
|
|
|
2009-09-03 04:44:56 +00:00
|
|
|
echo "</div>";
|
2009-09-10 06:57:06 +00:00
|
|
|
|
|
|
|
echo "<div id='monview'>";
|
|
|
|
echo "<p>View Options for <b>$name</b></p>";
|
|
|
|
//there should be many choices for the user to view the clusters' status
|
|
|
|
echo <<<TOS1
|
|
|
|
<table id="view_tab" class="tabTable" cellspacing="1">
|
|
|
|
<tbody>
|
|
|
|
TOS1;
|
|
|
|
if($name == "rmcmon") {
|
|
|
|
#display two rows, one for RMC event, another for RMC Resource Performance monitoring.
|
|
|
|
echo "<tr class='ListLine0' id='row0'>";
|
|
|
|
echo "<td>RMC Event Logs</td>";
|
|
|
|
echo "<td>";
|
|
|
|
insertButtons(array('label'=>'View in Text', 'id'=>'rmc_event_text', 'onclick'=>'loadMainPage("monitor/rmc_lsevent.php")'));
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
echo "<tr class='ListLine1' id='row1'>";
|
|
|
|
echo "<td>RMC Resource Logs</td>";
|
|
|
|
echo "<td>";
|
2009-09-17 14:54:43 +00:00
|
|
|
insertButtons(array('label'=>'View By text/graphics', 'id'=>'rmc_resrc_text', 'onclick'=>'loadMainPage("monitor/rmc_monshow.php")'));
|
2009-09-10 06:57:06 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo "<p>There's no view functions for $name.</p>";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "</tbody></table></div>";
|
2009-09-03 04:44:56 +00:00
|
|
|
}
|
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
/*displayMList() will display the list of monitor plugins
|
|
|
|
* For the new style monitor list
|
2009-09-10 06:57:06 +00:00
|
|
|
*/
|
2009-11-18 09:34:27 +00:00
|
|
|
function displayMList()
|
2009-09-10 06:57:06 +00:00
|
|
|
{
|
2009-11-18 09:34:27 +00:00
|
|
|
$xml = docmd("monls", "", array('-a'));
|
|
|
|
if(getXmlErrors($xml, $errors)) {
|
|
|
|
echo "<p class=Error>", implode(' ', $errors), "</p>";
|
2009-09-10 06:57:06 +00:00
|
|
|
exit;
|
|
|
|
}
|
2009-11-18 09:34:27 +00:00
|
|
|
|
|
|
|
foreach($xml->children() as $response) foreach ($response->children() as $data) {
|
|
|
|
list($name, $stat, $nodemon) = preg_split("/\s+/", $data);
|
|
|
|
//create .pluginstat class for each plugin
|
|
|
|
echo "<div class='pluginstat ui-corner-all' id=$name>";
|
|
|
|
//TODO: I have to make it beautiful
|
|
|
|
createPluginStatElem($name, $stat, $nodemon);
|
|
|
|
echo "</div>";
|
|
|
|
echo "<span class='ui-icon ui-icon-grip-dotted-horizontal'></span>";
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function createPluginStatElem($name, $stat, $nodemon)
|
|
|
|
{
|
|
|
|
if($nodemon) {
|
|
|
|
echo "<div class='lef'><span class='ui-icon ui-icon-circle-check'></span></div>";
|
|
|
|
echo "<div class='mid'>$name<br/>Enabled</div>";
|
|
|
|
}else {
|
|
|
|
echo "<div class='lef'><span class='ui-icon ui-icon-circle-close'></span></div>";
|
|
|
|
echo "<div class='mid ftsz'>$name<br />Disabled</div>";
|
2009-09-10 06:57:06 +00:00
|
|
|
}
|
2009-11-18 09:34:27 +00:00
|
|
|
echo "<div class='rig'></div>";
|
2009-09-10 06:57:06 +00:00
|
|
|
|
|
|
|
}
|
2009-09-03 04:44:56 +00:00
|
|
|
|
2009-07-29 06:07:58 +00:00
|
|
|
?>
|