rmc monitor page
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7248 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
11355fe8a2
commit
c30840f5c7
2119
xCAT-UI/js/jquery/jquery.flot.js
Normal file
2119
xCAT-UI/js/jquery/jquery.flot.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,8 @@
|
||||
var globalErrNodes;
|
||||
var globalNodesDetail;
|
||||
var globalAllNodesNum = 0;
|
||||
var globalFinishNodesNum = 0;
|
||||
|
||||
function loadRmcMon(){
|
||||
//find the rmcmon tab
|
||||
var rmcMonTab = $('#rmcmon');
|
||||
@ -28,7 +33,7 @@ function loadRmcMon(){
|
||||
loadRmcMonConfigure();
|
||||
|
||||
//add the content of the rmcmon, id = 'rmcMonTab'
|
||||
rmcMonTab.append("<div id='rmcMonShow'></div>");
|
||||
rmcMonTab.append("<div id='rmcMonShow'><div id='rmcmonSummary'></div><div id='rmcmonDetail'></div></div>");
|
||||
|
||||
//check the software work status by platform(linux and aix)
|
||||
$.ajax( {
|
||||
@ -96,6 +101,7 @@ function loadRmcMonConfigure(){
|
||||
$('#rmcMonConfig').hide();
|
||||
});
|
||||
}
|
||||
|
||||
function rsctRpmCheck(data){
|
||||
//linux had to check the rscp first
|
||||
if ('aix' != data.rsp){
|
||||
@ -185,6 +191,189 @@ function rmcWorkingCheck(){
|
||||
});
|
||||
}
|
||||
function loadRmcMonShow(){
|
||||
$('#rmcMonStatus').empty().append('The RMC Monitor is under construction.');
|
||||
$('#rmcMonShow').empty().append('under construction.');
|
||||
$('#rmcMonStatus').empty().append("Getting monitoring Data.");
|
||||
$('#rmcMonStatus').append(createLoader());
|
||||
|
||||
//load the rmc status summary
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'rmcshow;summary',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
showRmcSummary(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
|
||||
//load each nodes' status
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'rmcshow;lpar',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
parseRmcData(data.rsp);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showRmcSummary(returnData){
|
||||
var attributes = returnData.split(';');
|
||||
var attr;
|
||||
var attrName;
|
||||
var attrValues;
|
||||
var attrDiv;
|
||||
var summaryTable = $('<table><tbody></tbody></table>');
|
||||
var summaryRow;
|
||||
|
||||
|
||||
$('#rmcmonSummary').empty().append('<h3>Overview</h3><hr />');
|
||||
$('#rmcmonSummary').append(summaryTable);
|
||||
|
||||
for ( attr in attributes){
|
||||
var tempTd = $('<td style="border:0px;padding:15px 5px;"></td>');
|
||||
var tempArray = [];
|
||||
var temp = attributes[attr].indexOf(':');
|
||||
attrName = attributes[attr].substr(0, temp);
|
||||
attrValues = attributes[attr].substr(temp + 1).split(',');
|
||||
for (var i in attrValues){
|
||||
tempArray.push([i, attrValues[i]]);
|
||||
}
|
||||
|
||||
if (0 == (attr % 3)){
|
||||
summaryRow = $('<tr></tr>');
|
||||
summaryTable.append(summaryRow);
|
||||
}
|
||||
summaryRow.append(tempTd);
|
||||
attrDiv = $('<div class="monitorsumdiv"></div>');
|
||||
tempTd.append(attrDiv);
|
||||
$.plot(attrDiv, [tempArray]);
|
||||
attrDiv.append('<center>' + attrName + '</center>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function parseRmcData(returnData){
|
||||
var nodeName;
|
||||
var nodeStatus;
|
||||
var nodeChat;
|
||||
|
||||
//clean all the history data, because all of the follow variables are global
|
||||
globalAllNodesNum = returnData.length;
|
||||
globalFinishNodesNum = 0;
|
||||
globalErrNodes = {};
|
||||
globalNodesDetail = {};
|
||||
|
||||
for (var i in returnData){
|
||||
var temp = returnData[i].indexOf(':');;
|
||||
nodeName = returnData[i].substr(0, temp);
|
||||
nodeStatus = returnData[i].substr(temp + 1).replace(/(^\s*)|(\s*$)/g, '');
|
||||
|
||||
//not active nodes
|
||||
if ('OK' != nodeStatus){
|
||||
globalErrNodes[nodeName] = nodeStatus;
|
||||
globalFinishNodesNum ++;
|
||||
if (globalFinishNodesNum == globalAllNodesNum){
|
||||
showNodeDetail();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//ok
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'rmcshow;' + nodeName,
|
||||
msg : nodeName
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
var tempObject = {};
|
||||
for (var i in data.rsp){
|
||||
var temp = data.rsp[i].indexOf(':');
|
||||
var attrName = data.rsp[i].substr(0, temp);
|
||||
tempObject[attrName] = data.rsp[i].substr(temp + 1);
|
||||
}
|
||||
globalNodesDetail[data.msg] = tempObject;
|
||||
globalFinishNodesNum++;
|
||||
if (globalFinishNodesNum == globalAllNodesNum){
|
||||
showNodeDetail();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function showNodeDetail(){
|
||||
var nodeChat;
|
||||
//remember how many nodes parsed, used for adding new table row
|
||||
var parseNum = 0;
|
||||
var detailTable = $('<table><tbody></tbody></table>');
|
||||
var detailRow;
|
||||
|
||||
$('#rmcMonStatus').empty().append("RMC Monitoring Show");
|
||||
$('#rmcmonDetail').empty().append('<h3>Detail</h3><hr />');
|
||||
$('#rmcmonDetail').append(detailTable);
|
||||
|
||||
for (var nodeName in globalErrNodes){
|
||||
var tempTd = $('<td style="border:0px;padding:1px 1px;"></td>');
|
||||
if (0 == (parseNum % 4)){
|
||||
detailRow = $('<tr></tr>');
|
||||
detailTable.append(detailRow);
|
||||
}
|
||||
detailRow.append(tempTd);
|
||||
parseNum ++;
|
||||
nodeChat = $('<div class="monitornodediv"></div>');
|
||||
|
||||
if ('NA' == globalErrNodes[nodeName]){
|
||||
nodeChat.css('background-color', '#f47a55');
|
||||
nodeChat.append('<center><h4> Not Active</h4></center>');
|
||||
}
|
||||
else if ('NI' == globalErrNodes[nodeName]){
|
||||
nodeChat.css('background-color', '#ffce7b');
|
||||
nodeChat.append('<center><h4>' + nodeName + '\'s RSCT is not installed.</h4></center>');
|
||||
}
|
||||
else if ('NR' == globalErrNodes[nodeName]){
|
||||
nodeChat.css('background-color', '#ffce7b');
|
||||
nodeChat.append('<center><h4>' + nodeName + '\'s RSCT is not started.</h4></center>');
|
||||
}
|
||||
tempTd.append(nodeChat);
|
||||
tempTd.append('<center>' + nodeName + '</center>');
|
||||
}
|
||||
|
||||
for (var nodeName in globalNodesDetail){
|
||||
var tempTd = $('<td style="border:0px;padding:1px 1px;"></td>');
|
||||
if (0 == (parseNum % 4)){
|
||||
detailRow = $('<tr></tr>');
|
||||
detailTable.append(detailRow);
|
||||
}
|
||||
detailRow.append(tempTd);
|
||||
parseNum ++;
|
||||
nodeChat = $('<div class="monitornodediv"></div>');
|
||||
tempTd.append(nodeChat);
|
||||
|
||||
for (var attrName in globalNodesDetail[nodeName]){
|
||||
var tempData = globalNodesDetail[nodeName][attrName].split(',');
|
||||
var tempArray = [];
|
||||
for (var i in tempData){
|
||||
tempArray.push([i, tempData[i]]);
|
||||
}
|
||||
$.plot(nodeChat, [tempArray]);
|
||||
break;
|
||||
}
|
||||
tempTd.append('<center>' + nodeName + '</center>');
|
||||
}
|
||||
}
|
@ -405,6 +405,7 @@ function initPage() {
|
||||
includeJs("js/jquery/superfish.js");
|
||||
includeJs("js/jquery/hoverIntent.js");
|
||||
includeJs("js/jquery/jquery.tree.js");
|
||||
includeJs("js/jquery/jquery.flot.js");
|
||||
includeJs("js/configure/configure.js");
|
||||
includeJs("js/monitor/monitor.js");
|
||||
includeJs("js/nodes/nodes.js");
|
||||
|
Loading…
Reference in New Issue
Block a user