function loadGangliaMon(){ var gangMonTab = $('#gangliamon'); var gangMonStatus = createStatusBar('gangMonStatus'); gangMonTab.append(gangMonStatus); gangMonTab.append("
"); $('#gangMonConfig').hide(); addCfgButton(); gangMonTab.append(""); $('#gangLink').hide(); addGangLink(); $.ajax( { url : 'lib/systemcmd.php', dataType : 'json', data : { cmd : 'rpm -q rrdtool ganglia-gmetad ganglia-gmond ganglia-web' }, success : gangRpmCheck }); } function addCfgButton(){ var startButton = createButton('Start'); $('#gangMonConfig').append(startButton); startButton.bind('click', function(){ $.ajax({ url : 'lib/cmd.php', dataType : 'json', data : { cmd : 'webrun', tgt : '', args : 'gangliaStart', msg : '' }, success : function(data){ $('#rmcMonStatus').empty().append(data.rsp[0]); $('#gangLink').show(); } }); }); $('#gangMonConfig').append(startButton); var stopButton = createButton('Stop'); $('#gangMonConfig').append(startButton); stopButton.bind('click', function(){ $.ajax({ url : 'lib/cmd.php', dataType : 'json', data : { cmd : 'rmcstop', tgt : '', args : 'gangliamon,-r', msg : '' }, success : function(data){ $('#rmcMonStatus').empty().append(data.rsp[0]); $('#gangLink').hide(); } }); }); $('#gangMonConfig').append(stopButton); } function addGangLink(){ $('#gangLink').append('The Ganglia is running now.References: xCAT2-Monitoring.pdf.
"; $('#gangMonStatus').empty().append(showString); return; } $('#gangMonConfig').show(); $.ajax({ url : 'lib/cmd.php', dataType : 'json', data : { cmd : 'monls', tgt : '', args : 'gangliamon', msg : '' }, success : function(data){ if (-1 != data.rsp[0].indexOf("not-monitored")){ $('#gangMonStatus').empty().append("Please start the Ganglia Monitoring first."); return; } $('#gangLink').show(); } }); }