2010-06-16 18:21:58 +00:00
|
|
|
/**
|
|
|
|
* Global variables
|
|
|
|
*/
|
|
|
|
var monitorTabs; // Monitor tabs
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the monitor tab
|
|
|
|
*
|
|
|
|
* @param o
|
|
|
|
* Tab object
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
|
|
|
function setMonitorTab(o) {
|
|
|
|
monitorTabs = o;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the monitor tab
|
|
|
|
*
|
|
|
|
* @param Nothing
|
|
|
|
* @return Tab object
|
|
|
|
*/
|
|
|
|
function getMonitorTab() {
|
|
|
|
return monitorTabs;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the monitor page
|
|
|
|
*
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
|
|
|
function loadMonitorPage() {
|
|
|
|
// If the page is already loaded
|
|
|
|
if ($('#monitor_page').children().length) {
|
|
|
|
// Do not reload the monitor page
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create monitor tab
|
|
|
|
var tab = new Tab();
|
|
|
|
setConfigTab(tab);
|
|
|
|
tab.init();
|
2010-07-14 20:11:07 +00:00
|
|
|
$('#content').append(tab.object());
|
2010-06-16 18:21:58 +00:00
|
|
|
|
|
|
|
// Create provision tab
|
|
|
|
var tab = new Tab();
|
|
|
|
setMonitorTab(tab);
|
|
|
|
tab.init();
|
2010-07-14 20:11:07 +00:00
|
|
|
$('#content').append(tab.object());
|
2010-06-16 18:21:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Monitor nodes
|
|
|
|
*/
|
2010-09-11 13:06:07 +00:00
|
|
|
var monitorForm = $('<div class="form"></div>');
|
2010-06-16 18:21:58 +00:00
|
|
|
|
|
|
|
// Create info bar
|
2010-08-04 08:49:20 +00:00
|
|
|
var monitorInfoBar = createInfoBar('Select the Monitor Tool');
|
2010-06-16 18:21:58 +00:00
|
|
|
monitorForm.append(monitorInfoBar);
|
|
|
|
|
|
|
|
// Create drop-down menu
|
|
|
|
// Hardware available to provision - ipmi, blade, hmc, ivm, fsp, and zvm
|
2010-08-04 08:49:20 +00:00
|
|
|
|
2010-09-11 13:06:07 +00:00
|
|
|
var monitorList = $('<ol></ol>');
|
2010-08-04 08:49:20 +00:00
|
|
|
var items = "<li><a href='#' name='xcatmon'>xCAT Monitor</a> : xcatmon provides node status " +
|
|
|
|
"monitoring using fping on AIX and nmap on Linux. It also provides application " +
|
|
|
|
"status monitoring. The status and the appstatus columns of the nodelist table " +
|
|
|
|
"will be updated periodically with the latest status values for the nodes.<li>";
|
|
|
|
|
|
|
|
items += "<li><a href='#' name='rmcmon'>RMC Monitor</a> : IBM's Resource Monitoring and Control (RMC) " +
|
|
|
|
"subsystem is our recommended software for monitoring xCAT clusters. It's is part " +
|
|
|
|
"of the IBM's Reliable Scalable Cluster Technology (RSCT) that provides a comprehensive " +
|
|
|
|
"clustering environment for AIX and LINUX.<li>";
|
2010-09-17 08:39:17 +00:00
|
|
|
items += "<li><a href='#' name='gangliamon'>Ganglia Monitor</a> : Ganglia is a scalable distributed " +
|
|
|
|
"monitoring system for high-performance computing systems such as clusters and Grids.<li>";
|
2010-08-04 08:49:20 +00:00
|
|
|
items += "<li><a href='#' name='pcpmon'>PCP Monitor</a> : <li>";
|
|
|
|
|
|
|
|
monitorList.append(items);
|
|
|
|
|
|
|
|
$('a', monitorList).click(function(){
|
|
|
|
loadMonitorTab($(this).attr('name'));
|
|
|
|
});
|
|
|
|
|
|
|
|
monitorForm.append(monitorList);
|
2010-08-03 14:58:08 +00:00
|
|
|
tab.add('monitorTab', 'Monitor', monitorForm, false);
|
2010-06-16 18:21:58 +00:00
|
|
|
|
|
|
|
/**
|
2010-08-03 14:16:24 +00:00
|
|
|
* Monitor resources
|
2010-06-16 18:21:58 +00:00
|
|
|
*/
|
2010-09-11 13:06:07 +00:00
|
|
|
var resrcForm = $('<div class="form"></div>');
|
2010-06-16 18:21:58 +00:00
|
|
|
|
|
|
|
// Create info bar
|
2010-09-08 15:52:50 +00:00
|
|
|
var resrcInfoBar = createInfoBar('View current resources');
|
2010-06-16 18:21:58 +00:00
|
|
|
resrcForm.append(resrcInfoBar);
|
2010-07-15 23:22:13 +00:00
|
|
|
|
2010-08-03 14:16:24 +00:00
|
|
|
// Create radio buttons for platforms
|
2010-09-08 15:52:50 +00:00
|
|
|
var hwList =$('<ol>Select a platform to view its current resources:</ol>');
|
2010-08-03 14:16:24 +00:00
|
|
|
var ipmi = $('<li><input type="radio" name="hw" value="ipmi" checked/>ipmi</li>');
|
|
|
|
var blade = $('<li><input type="radio" name="hw" value="blade"/>blade</li>');
|
|
|
|
var hmc = $('<li><input type="radio" name="hw" value="hmc"/>hmc</li>');
|
|
|
|
var ivm = $('<li><input type="radio" name="hw" value="ivm"/>ivm</li>');
|
|
|
|
var fsp = $('<li><input type="radio" name="hw" value="fsp"/>fsp</li>');
|
|
|
|
var zvm = $('<li><input type="radio" name="hw" value="zvm"/>zvm</li>');
|
|
|
|
|
|
|
|
hwList.append(ipmi);
|
|
|
|
hwList.append(blade);
|
|
|
|
hwList.append(hmc);
|
|
|
|
hwList.append(ivm);
|
|
|
|
hwList.append(fsp);
|
|
|
|
hwList.append(zvm);
|
|
|
|
resrcForm.append(hwList);
|
|
|
|
|
2010-06-16 18:21:58 +00:00
|
|
|
/**
|
|
|
|
* Ok
|
|
|
|
*/
|
|
|
|
var okBtn = createButton('Ok');
|
|
|
|
okBtn.bind('click', function(event) {
|
|
|
|
// Get hardware that was selected
|
2010-08-03 14:16:24 +00:00
|
|
|
var hw = $(this).parent().find('input[name="hw"]:checked').val();
|
2010-06-16 18:21:58 +00:00
|
|
|
|
|
|
|
// Generate new tab ID
|
|
|
|
var newTabId = hw + 'ResourceTab';
|
|
|
|
if (!$('#' + newTabId).length) {
|
2010-07-15 23:22:13 +00:00
|
|
|
var loader = createLoader(hw + 'ResourceLoader');
|
2010-06-16 18:21:58 +00:00
|
|
|
loader = $('<center></center>').append(loader);
|
2010-08-03 14:58:08 +00:00
|
|
|
tab.add(newTabId, hw, loader, true);
|
2010-06-16 18:21:58 +00:00
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
// Create an instance of the plugin
|
|
|
|
var plugin;
|
|
|
|
switch(hw) {
|
|
|
|
case "blade":
|
2010-07-23 18:47:54 +00:00
|
|
|
plugin = new bladePlugin();
|
2010-07-22 19:56:09 +00:00
|
|
|
break;
|
|
|
|
case "fsp":
|
2010-07-23 18:47:54 +00:00
|
|
|
plugin = new fspPlugin();
|
2010-07-22 19:56:09 +00:00
|
|
|
break;
|
|
|
|
case "hmc":
|
2010-07-23 18:47:54 +00:00
|
|
|
plugin = new hmcPlugin();
|
2010-07-22 19:56:09 +00:00
|
|
|
break;
|
|
|
|
case "ipmi":
|
2010-07-23 18:47:54 +00:00
|
|
|
plugin = new ipmiPlugin();
|
2010-07-22 19:56:09 +00:00
|
|
|
break;
|
|
|
|
case "ivm":
|
2010-07-23 18:47:54 +00:00
|
|
|
plugin = new ivmPlugin();
|
2010-07-22 19:56:09 +00:00
|
|
|
break;
|
|
|
|
case "zvm":
|
2010-07-23 18:47:54 +00:00
|
|
|
plugin = new zvmPlugin();
|
2010-07-22 19:56:09 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin.loadResources();
|
2010-06-16 18:21:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Select tab
|
|
|
|
tab.select(newTabId);
|
|
|
|
});
|
|
|
|
resrcForm.append(okBtn);
|
|
|
|
|
2010-08-03 14:58:08 +00:00
|
|
|
tab.add('resourceTab', 'Resources', resrcForm, false);
|
2010-08-04 08:49:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadMonitorTab(monitorName){
|
|
|
|
//the tab is exist then we only need to select it
|
|
|
|
var tab = getMonitorTab();
|
|
|
|
if (0 != $("#" + monitorName).length){
|
|
|
|
tab.select(monitorName);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(monitorName){
|
|
|
|
case 'xcatmon':
|
|
|
|
tab.add(monitorName, 'xCAT Monitor', '', true);
|
|
|
|
loadXcatMon();
|
|
|
|
break;
|
|
|
|
case 'rmcmon':
|
|
|
|
tab.add(monitorName, 'RMC Monitor', '', true);
|
|
|
|
loadRmcMon();
|
|
|
|
break;
|
|
|
|
case 'gangliamon':
|
2010-09-17 08:39:17 +00:00
|
|
|
tab.add(monitorName, 'Ganglia Monitor', '', true);
|
|
|
|
loadGangliaMon();
|
2010-08-04 08:49:20 +00:00
|
|
|
break;
|
|
|
|
case 'pcpmon':
|
|
|
|
loadUnfinish(monitorName, tab);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
tab.select(monitorName);
|
|
|
|
}
|
|
|
|
|
|
|
|
function loadUnfinish(monitorName, tab){
|
|
|
|
var unfinishPage = $('<div></div>');
|
|
|
|
unfinishPage.append(createInfoBar('under construction.'));
|
|
|
|
|
2010-09-17 08:39:17 +00:00
|
|
|
tab.add(monitorName, 'unfinish', unfinishPage, true);
|
2010-06-16 18:21:58 +00:00
|
|
|
}
|