function loadRmcMon(){ //find the rmcmon tab var rmcMonTab = $('#rmcmon'); //add the stauts bar first. id = 'rmcMonStatus' var rmcStatusBar = createStatusBar('rmcMonStatus'); rmcStatusBar.append(createLoader()); rmcMonTab.append(rmcStatusBar); //add the configure button. var configButton = createButton('Configure'); configButton.hide(); configButton.click(function(){ if ($('#rmcMonConfig').is(':hidden')){ $('#rmcMonConfig').show(); } else{ $('#rmcMonConfig').hide(); } }); rmcMonTab.append(configButton); //add configure div rmcMonTab.append("
"); $('#rmcMonConfig').hide(); //load the configure div's content loadRmcMonConfigure(); //add the content of the rmcmon, id = 'rmcMonTab' rmcMonTab.append(""); //check the software work status by platform(linux and aix) $.ajax( { url : 'lib/systemcmd.php', dataType : 'json', data : { cmd : 'ostype' }, success : rsctRpmCheck }); } function loadRmcMonConfigure(){ //get the configure div and clean its content. var rmcmonCfgDiv = $('#rmcMonConfig'); rmcmonCfgDiv.empty(); //add the start button var startButton = createButton('Start'); rmcmonCfgDiv.append(startButton); startButton.click(function(){ $('#rmcMonStatus').empty().append(createLoader()); $.ajax({ url : 'lib/cmd.php', dataType : 'json', data : { cmd : 'webrun', tgt : '', args : 'rmcstart;lpar', msg : '' }, success : function(data){ $('#rmcMonStatus').empty().append(data.rsp[0]); } }); }); //add the stop button var stopButton = createButton('Stop'); rmcmonCfgDiv.append(stopButton); stopButton.click(function(){ $('#rmcMonStatus').empty().append(createLoader()); $.ajax({ url : 'lib/cmd.php', dataType : 'json', data : { cmd : 'monstop', tgt : '', args : 'rmcmon', msg : '' }, success : function(data){ $('#rmcMonStatus').empty().append(data.rsp[0]); } }); }); //add the cancel button var cancelButton = createButton('Cancel'); rmcmonCfgDiv.append(cancelButton); cancelButton.click(function(){ $('#rmcMonConfig').hide(); }); } function rsctRpmCheck(data){ //linux had to check the rscp first if ('aix' != data.rsp){ $.ajax( { url : 'lib/systemcmd.php', dataType : 'json', data : { cmd : 'rpm -q rsct.core' }, success : function(data){ if (-1 != data.rsp.indexOf("not")){ $('#rmcMonStatus').empty().append( 'Please install the RSCT first.