2011-08-09 09:10:51 +00:00
|
|
|
<?php
|
|
|
|
echo <<<EEE
|
|
|
|
<html>
|
2012-05-01 23:43:11 +00:00
|
|
|
<head>
|
|
|
|
<title>Node {$_GET['n']} Ganglia Report</title>
|
|
|
|
<meta content="600" http-equiv="refresh">
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
|
|
|
<link href="css/style.css" rel=stylesheet type="text/css">
|
|
|
|
<link href="css/jquery.jqplot.css" rel=stylesheet type="text/css">
|
|
|
|
<script type="text/javascript" src="js/jquery/jquery.min.js"></script>
|
|
|
|
<script type="text/javascript" src="js/jquery/jquery-ui.min.js"></script>
|
|
|
|
<script type="text/javascript" src="js/ui.js"></script>
|
2011-08-09 09:10:51 +00:00
|
|
|
EEE;
|
|
|
|
?>
|
2012-05-01 23:43:11 +00:00
|
|
|
|
2011-08-09 09:10:51 +00:00
|
|
|
<script type="text/javascript">
|
2013-02-05 15:43:57 +00:00
|
|
|
window.onload=function() {
|
2011-08-09 09:10:51 +00:00
|
|
|
includeJs("js/jquery/jquery.jqplot.min.js");
|
|
|
|
includeJs("js/jquery/jqplot.dateAxisRenderer.min.js");
|
|
|
|
includeJs("js/jquery/jqplot.dateAxisRenderer.min.js");
|
|
|
|
includeJs("js/monitor/gangliamon.js");
|
2013-02-05 15:43:57 +00:00
|
|
|
|
|
|
|
var nodePath = $('#nodepath').val();
|
2011-08-09 09:10:51 +00:00
|
|
|
$.ajax({
|
|
|
|
url : 'lib/cmd.php',
|
|
|
|
dataType : 'json',
|
|
|
|
data : {
|
|
|
|
cmd : 'webrun',
|
|
|
|
tgt : '',
|
2013-02-05 15:43:57 +00:00
|
|
|
args : 'gangliashow;' + nodePath + ';hour;_summary_',
|
2011-08-09 09:10:51 +00:00
|
|
|
msg : ''
|
|
|
|
},
|
|
|
|
|
|
|
|
success: function(data){
|
|
|
|
drawNodesummary(data.rsp[0]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
function drawNodesummary(summaryString){
|
2013-02-05 15:43:57 +00:00
|
|
|
var nodeName = $('#nodename').val();
|
2012-05-01 23:43:11 +00:00
|
|
|
var nodeData = new Object();
|
|
|
|
var metricArray = summaryString.split(';');
|
2013-02-05 15:43:57 +00:00
|
|
|
var metricName = '';
|
2011-08-09 09:10:51 +00:00
|
|
|
var valueArray = '';
|
|
|
|
var position = 0;
|
|
|
|
var tempLength = 0;
|
|
|
|
for (var index = 0; index < metricArray.length; index++){
|
|
|
|
position = metricArray[index].indexOf(':');
|
|
|
|
|
2013-02-05 15:43:57 +00:00
|
|
|
metricName = metricArray[index].substr(0, position);
|
|
|
|
nodeData[metricName] = new Array();
|
2011-08-09 09:10:51 +00:00
|
|
|
valueArray = metricArray[index].substr(position + 1).split(',');
|
|
|
|
tempLength = valueArray.length;
|
|
|
|
|
|
|
|
for (var i = 0; i < tempLength; i++){
|
2013-02-05 15:43:57 +00:00
|
|
|
nodeData[metricName].push(Number(valueArray[i]));
|
2011-08-09 09:10:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-05 15:43:57 +00:00
|
|
|
drawLoadFlot('ganglianodeload', nodeName, nodeData['load_one'], nodeData['cpu_num']);
|
|
|
|
drawCpuFlot('ganglianodecpu', nodeName, nodeData['cpu_idle']);
|
|
|
|
drawMemFlot('ganglianodemem', nodeName, nodeData['mem_free'], nodeData['mem_total']);
|
|
|
|
drawDiskFlot('ganglianodedisk', nodeName, nodeData['disk_free'], nodeData['disk_total']);
|
|
|
|
drawNetworkFlot('ganglianodenetwork', nodeName, nodeData['bytes_in'], nodeData['bytes_out']);
|
2011-08-09 09:10:51 +00:00
|
|
|
}
|
|
|
|
</script>
|
2012-05-01 23:43:11 +00:00
|
|
|
|
2011-08-09 09:10:51 +00:00
|
|
|
<?php
|
|
|
|
echo <<<EEE
|
2012-05-01 23:43:11 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<input id="nodename" type="hidden" value="{$_GET['n']}"></input>
|
|
|
|
<input id="nodepath" type="hidden" value="{$_GET['p']}"></input>
|
|
|
|
<div style="background-color:white;" class="tab">
|
|
|
|
<table style="border-style:none;">
|
|
|
|
<tr>
|
|
|
|
<td style="padding:0;border-style:none;"><div id="ganglianodeload" class="monitor-sum-div"></div></td>
|
|
|
|
<td style="padding:0;border-style:none;"><div id="ganglianodecpu" class="monitor-sum-div"></div></td>
|
|
|
|
<td style="padding:0;border-style: none;"><div id="ganglianodemem" class="monitor-sum-div"></div></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td style="padding:0;border-style:none;"><div id="ganglianodedisk" class="monitor-sum-div"></div></td>
|
|
|
|
<td style="padding:0;border-style:none;"><div id="ganglianodenetwork" class="monitor-sum-div"></div></td>
|
|
|
|
<td style="padding:0;border-style:none;"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</body>
|
2011-08-09 09:10:51 +00:00
|
|
|
</html>
|
|
|
|
EEE;
|
|
|
|
?>
|