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-12-04 15:42:49 +00:00
|
|
|
var monitorInfoBar = createInfoBar('Select a monitoring tool to use.');
|
2010-06-16 18:21:58 +00:00
|
|
|
monitorForm.append(monitorInfoBar);
|
|
|
|
|
2010-11-05 22:53:47 +00:00
|
|
|
// Create a list of monitoring tools
|
2010-09-11 13:06:07 +00:00
|
|
|
var monitorList = $('<ol></ol>');
|
2010-11-05 22:53:47 +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>";
|
|
|
|
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-11-30 01:42:44 +00:00
|
|
|
items += "<li><a href='#' name='pcpmon'>PCP Monitor</a> : Under construction.<li>";
|
2010-08-04 08:49:20 +00:00
|
|
|
monitorList.append(items);
|
2010-11-05 22:53:47 +00:00
|
|
|
|
|
|
|
// Open new tab for monitor tool
|
|
|
|
$('a', monitorList).click(function() {
|
2010-08-04 08:49:20 +00:00
|
|
|
loadMonitorTab($(this).attr('name'));
|
|
|
|
});
|
2010-11-05 22:53:47 +00:00
|
|
|
|
2010-08-04 08:49:20 +00:00
|
|
|
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-12-04 15:42:49 +00:00
|
|
|
var resrcInfoBar = createInfoBar('Select a platform to view its 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-12-04 15:42:49 +00:00
|
|
|
var hwList = $('<ol>Platform to view:</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-11-05 22:53:47 +00:00
|
|
|
|
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;
|
2010-11-05 22:53:47 +00:00
|
|
|
switch (hw) {
|
|
|
|
case "blade":
|
|
|
|
plugin = new bladePlugin();
|
|
|
|
break;
|
|
|
|
case "fsp":
|
|
|
|
plugin = new fspPlugin();
|
|
|
|
break;
|
|
|
|
case "hmc":
|
|
|
|
plugin = new hmcPlugin();
|
|
|
|
break;
|
|
|
|
case "ipmi":
|
|
|
|
plugin = new ipmiPlugin();
|
|
|
|
break;
|
|
|
|
case "ivm":
|
|
|
|
plugin = new ivmPlugin();
|
|
|
|
break;
|
|
|
|
case "zvm":
|
|
|
|
plugin = new zvmPlugin();
|
|
|
|
break;
|
2010-07-22 19:56:09 +00:00
|
|
|
}
|
2010-11-05 22:53:47 +00:00
|
|
|
|
2010-07-22 19:56:09 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2010-11-05 22:53:47 +00:00
|
|
|
/**
|
|
|
|
* Open a tab and load given monitoring tool
|
|
|
|
*
|
|
|
|
* @param monitorName
|
|
|
|
* Name of monitoring tool
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
|
|
|
function loadMonitorTab(monitorName) {
|
2010-10-08 03:03:42 +00:00
|
|
|
// If the tab exist, then we only need to select it
|
2010-08-04 08:49:20 +00:00
|
|
|
var tab = getMonitorTab();
|
2010-11-05 22:53:47 +00:00
|
|
|
if ($("#" + monitorName).length) {
|
2010-08-04 08:49:20 +00:00
|
|
|
tab.select(monitorName);
|
|
|
|
return;
|
|
|
|
}
|
2010-11-05 22:53:47 +00:00
|
|
|
|
|
|
|
switch (monitorName) {
|
|
|
|
case 'xcatmon':
|
|
|
|
tab.add(monitorName, 'xCAT', '', true);
|
|
|
|
loadXcatMon();
|
|
|
|
break;
|
|
|
|
case 'rmcmon':
|
|
|
|
tab.add(monitorName, 'RMC', '', true);
|
|
|
|
loadRmcMon();
|
|
|
|
break;
|
|
|
|
case 'gangliamon':
|
|
|
|
tab.add(monitorName, 'Ganglia', '', true);
|
|
|
|
loadGangliaMon();
|
|
|
|
break;
|
|
|
|
case 'pcpmon':
|
|
|
|
loadUnfinish(monitorName, tab);
|
|
|
|
break;
|
2010-08-04 08:49:20 +00:00
|
|
|
}
|
2010-11-05 22:53:47 +00:00
|
|
|
|
2010-08-04 08:49:20 +00:00
|
|
|
tab.select(monitorName);
|
|
|
|
}
|
|
|
|
|
2010-11-05 22:53:47 +00:00
|
|
|
/**
|
|
|
|
* Open a tab and show 'Under contruction'
|
|
|
|
*
|
|
|
|
* @param monitorName
|
|
|
|
* Name of monitoring tool
|
|
|
|
* @param tab
|
|
|
|
* Tab area
|
|
|
|
* @return Nothing
|
|
|
|
*/
|
|
|
|
function loadUnfinish(monitorName, tab) {
|
2010-08-04 08:49:20 +00:00
|
|
|
var unfinishPage = $('<div></div>');
|
2010-11-05 22:53:47 +00:00
|
|
|
unfinishPage.append(createInfoBar('Under construction'));
|
|
|
|
tab.add(monitorName, 'Unfinish', unfinishPage, true);
|
2010-06-16 18:21:58 +00:00
|
|
|
}
|