base
This commit is contained in:
@@ -0,0 +1,442 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>######## SYSTEM-HOSTING SERVICE STATUS ######## </title>
|
||||
<STYLE type=text/css>
|
||||
TD { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; }
|
||||
TR { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; }
|
||||
TABLE { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; line-height : 120%}
|
||||
INPUT { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; line-height : 120%}
|
||||
}
|
||||
</STYLE>
|
||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||
<meta http-equiv="Expires" content="0"/>
|
||||
<meta http-equiv="Pragma" content="no-cache"/>
|
||||
<link rel="stylesheet" href="clockstyle.css" type="text/css">
|
||||
<style type="text/css">
|
||||
#tooltip {position:absolute;
|
||||
top:5;
|
||||
left:5;
|
||||
border:solid 3 ffccff;
|
||||
background:ffffcc;
|
||||
color:660066;
|
||||
font-size:9pt;
|
||||
width:200;
|
||||
height:20;
|
||||
padding:2;
|
||||
overflow:hidden;
|
||||
z-index:10;
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
<? require "layer.js";?>
|
||||
<script language="javascript1.2" type="text/javascript" src="clock.js" ></script>
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
function changeVisual()
|
||||
{
|
||||
fr = document.frm;
|
||||
|
||||
if(fr.chk.value == 0) {
|
||||
fr.chk.value = 1;
|
||||
info.style.display="block";
|
||||
} else {
|
||||
fr.chk.value = 0;
|
||||
info.style.display="none";
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onLoad="UpdateClocks()">
|
||||
<form name="frm" action=<?=$PHP_SELF?> method=POST>
|
||||
<table border="0" cellspacing="0" width="100%">
|
||||
<tr bgcolor=#003366 class="ratNavText">
|
||||
<td ID="Clock0" width="25%" > </td>
|
||||
<td ID="Clock1" width="25%" > </td>
|
||||
<td ID="Clock2" width="25%" > </td>
|
||||
<td ID="Clock3" width="25%" > </td>
|
||||
</tr>
|
||||
<tr bgcolor=#003366 class="ratNavText">
|
||||
<td ID="Clock4" width="25%" > </td>
|
||||
<td ID="Clock5" width="25%" > </td>
|
||||
<td ID="Clock6" width="25%" > </td>
|
||||
<td ID="Clock7" width="25%" > </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table border="0" cellspacing="1" width="530" align="center">
|
||||
<tr align="center">
|
||||
<td> <h3>######## SYSTEM-HOSTING SERVICE STATUS ########</h3></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" align="center" width="1050">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="javascript:changeVisual();">클릭</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
$monitor_member = array("SE ROOM"=>"031-788-0191",
|
||||
"강명균"=>"016-574-5625",
|
||||
"최현선(주중야간)"=>"011-365-0370",
|
||||
"박성우(주중야간)"=>"011-9953-7630",
|
||||
"김기백(주중주간)"=>"017-608-2385",
|
||||
"김동민(주말야간)"=>"011-9719-8899",
|
||||
"김경완"=>"011-9279-1325, 010-2800-1325",
|
||||
"신동호"=>"017-713-4785",
|
||||
"박정제"=>"011-9737-1955, 02-805-1955",
|
||||
"강중권"=>"011-745-4849, 02-868-6378",
|
||||
"임상현"=>"019-376-1236, 010-3337-1236",
|
||||
"배상범"=>"010-4613-8795, 010-4631-8795");
|
||||
?>
|
||||
<div id="info" style="DISPLAY:none;">
|
||||
<table border="1" cellspacing="1" width="530" align="center">
|
||||
<tr align="center">
|
||||
<td><b> Priority </b></td>
|
||||
<td><b> Name </b></td>
|
||||
<td><b> Emergency Phone NO. </b> </td>
|
||||
</tr>
|
||||
<?
|
||||
$i = 0;
|
||||
while(list($key, $value) = each($monitor_member))
|
||||
{
|
||||
$i++;
|
||||
echo"<tr align=\"center\" align=\"center\">\n";
|
||||
echo" <td><b> ".$i.". </b></td>\n";
|
||||
echo" <td><b> ".$key." </b></td>\n";
|
||||
echo" <td><b> ".$value." </b></td>\n";
|
||||
echo"</tr>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<marquee id="tooltip" name="tooltip"></marquee>
|
||||
<?
|
||||
$server_addr[0][0] = "127.0.0.1";
|
||||
$server_addr[0][1] = "30001";
|
||||
$server_addr[0][2] = "DREAMLINE-1";
|
||||
/*
|
||||
$server_addr[1][0] = "127.0.0.1";
|
||||
$server_addr[1][1] = "30001";
|
||||
$server_addr[1][2] = "DREAMLINE-2";
|
||||
*/
|
||||
|
||||
$tot = count($server_addr);
|
||||
for($i=0; $i < $tot; $i++){
|
||||
|
||||
if($i%3 == 0) echo "<table align=\"center\"><tr>";
|
||||
|
||||
$fp = @fsockopen("udp://{$server_addr[$i][0]}", $server_addr[$i][1], $errno, $errstr);
|
||||
if (!$fp) {
|
||||
echo "ERROR: $errno - $errstr<br>\n";
|
||||
continue;
|
||||
} else {
|
||||
fwrite($fp,"GET_SERVSTATUS", 15);
|
||||
while(1) {
|
||||
$test2 = fread($fp, 2048);
|
||||
$test .= trim($test2);
|
||||
$j = strlen($test2);
|
||||
//echo $test2;
|
||||
if($j < 1024) break;
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
echo "<!-- $test -->";
|
||||
$pt = new parsePipe();
|
||||
$result = $pt->parseIt($test);
|
||||
|
||||
$tot_tr = $pt->countIt();
|
||||
//echo $tot_tr
|
||||
?>
|
||||
<td valign=top><table border=1 cellpadding=1 cellspacing=0>
|
||||
<tr height="35">
|
||||
<td colspan="9">
|
||||
<center><b>
|
||||
<font color="#000066" size="4">
|
||||
MNG SERVER IP: <?=$server_addr[$i][0]?>, PORT: <?=$server_addr[$i][1]?>
|
||||
(<?=$server_addr[$i][2]?>)
|
||||
</font>
|
||||
</b>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td width="170"><center><b><font color="#000066">Name</font></b></center></td>
|
||||
<td width="110"><center><b><font color="#000066">Server IP</font></b></center></td>
|
||||
<td width="50"><center><b><font color="#000066">Server Port</font></b></center></td>
|
||||
<td width="150"><center><b><font color="#000066">Last Status Changed At</font></b></center></td>
|
||||
<td width="150"><center><b><font color="#000066">Last Disk Checked At</font></b></center></td>
|
||||
<td width="170"><center><b><font color="#000066">Domain</font></b></center></td>
|
||||
<td width="70"><center><b><font color="#000066">Total Disk</font></b></center></td>
|
||||
<td width="70"><center><b><font color="#000066">Free</font></b></center></td>
|
||||
<td width="70"><center><b><font color="#000066">Used</font></b></center></td>
|
||||
</tr>
|
||||
<?
|
||||
$totalDisk = 0;
|
||||
$freeDisk = 0;
|
||||
$usedDisk = 0;
|
||||
$chkServiceName = "";
|
||||
for($j=0; $j<$tot_tr; $j++){
|
||||
$serviceName_tmp = explode("_",$result[$j][2]);
|
||||
$serviceName = $serviceName_tmp[0];
|
||||
|
||||
$alt_str = "[$j]".
|
||||
" [SVC NAME] : $serviceName".
|
||||
" [SERVER STATUS] : ".$pt->translateIt($result[$j][0], 2).
|
||||
" [SERVER NAME] : ".$pt->translateIt($result[$j][2],3).
|
||||
" [SERVER IP] : ".$pt->translateIt($result[$j][3],3).
|
||||
" [SERVER PORT] : ".$pt->translateIt($result[$j][4],4);
|
||||
|
||||
if($chkServiceName ==""){
|
||||
$chkServiceName = $serviceName;
|
||||
echo "<!-- 1 -->";
|
||||
?>
|
||||
<tr>
|
||||
<td align="center" colspan="9"><font size=3><b><?=$serviceName?> Service Status</td>
|
||||
</tr>
|
||||
<?
|
||||
}else if($chkServiceName == $serviceName){
|
||||
//Do nothing, we're still on the same service
|
||||
echo "<!-- 2 -->";
|
||||
}else{
|
||||
//통계 중간 합산 출력 (윗줄까지의 서비스명과 현재줄의 서비스명이 다른 경우
|
||||
echo "<!-- 3 ".$chkServiceName." , ".$serviceName." -->";
|
||||
?>
|
||||
<tr>
|
||||
<td align="center" colspan="6"><b><?=$chkServiceName?> Storage Total</b></td>
|
||||
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($totalDisk, 9)?></td>
|
||||
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($freeDisk, 9)?></td>
|
||||
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($usedDisk, 9)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="9"><font size=3><b><?=$serviceName?> Service Status</td>
|
||||
</tr>
|
||||
<?
|
||||
$totalDisk = 0;
|
||||
$freeDisk = 0;
|
||||
$usedDisk = 0;
|
||||
$chkServiceName = $serviceName;
|
||||
echo "<!-- 4 ".$chkServiceName." , ".$serviceName." -->";
|
||||
}
|
||||
|
||||
$totalDisk += $result[$j][8];
|
||||
$freeDisk += $result[$j][9];
|
||||
$usedDisk += ($result[$j][8] - $result[$j][9]);
|
||||
echo "<!-- ".$pt->translateIt($result[$j][2],3)."TOT ".$pt->translateIt($totalDisk, 9)." FREE ".$pt->translateIt($freeDisk, 9)." -->";
|
||||
|
||||
?>
|
||||
<span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();">
|
||||
<tr>
|
||||
<td>(<?=$pt->translateIt($result[$j][0],1)?> <?=$pt->translateIt($result[$j][1],0)?>) <?=$result[$j][2]?></td>
|
||||
<td align="center"><?=$pt->translateIt($result[$j][3],3)?></td>
|
||||
<td align="center"><?=$pt->translateIt($result[$j][4],4)?></td>
|
||||
<td align="center"><?=date("Y-m-d H:i:s", $result[$j][5])?></td>
|
||||
<td align="center">
|
||||
<?
|
||||
if ($result[$j][6] == "-") {
|
||||
echo "-";
|
||||
} else {
|
||||
echo date("Y-m-d H:i:s", $result[$j][6]);
|
||||
}
|
||||
?></td>
|
||||
<td align="center"><?=$pt->translateIt($result[$j][7],7)?></td>
|
||||
<td align="center"><?=$pt->translateIt($result[$j][8],8)?></td>
|
||||
<td align="center" bgcolor="<?=$pt->translateIt($result[$j][10],100)?>"><?=$pt->translateIt(trim($result[$j][9]), 8)?></td>
|
||||
<td align="center">
|
||||
<?
|
||||
if($result[$j][8] == "-") echo "-";
|
||||
else if($result[$j][8] == "0") echo "disabled";
|
||||
else echo $pt->translateIt($result[$j][8]-$result[$j][9], 8);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</span>
|
||||
<?
|
||||
}
|
||||
//가장 마지막 서비스 통계 출력
|
||||
?>
|
||||
<tr>
|
||||
<td align="center" colspan="6"><b><?=$chkServiceName?> Storage Total</b></td>
|
||||
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($totalDisk, 9)?></td>
|
||||
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($freeDisk, 9)?></td>
|
||||
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($usedDisk, 9)?></td>
|
||||
</tr>
|
||||
|
||||
</table></td>
|
||||
<?
|
||||
if($i%3 == 2) echo "</table></tr>"; //
|
||||
}
|
||||
?>
|
||||
<table>
|
||||
</table>
|
||||
<?
|
||||
|
||||
////////////////////
|
||||
//Print REFRESHER
|
||||
////////////////////
|
||||
|
||||
extract($_POST);
|
||||
if($refresh_rate<1 || $refresh_rate>1000)
|
||||
$refresh_rate = 60;
|
||||
|
||||
?>
|
||||
<br>
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
Refresh Rate :
|
||||
<input type=text name=refresh_rate value=<?=$refresh_rate?>>
|
||||
<input type=submit value=SET>
|
||||
(MIN : 1, MAX : 1000)
|
||||
<input type="hidden" name="chk" value="0">
|
||||
</form>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td align=right>
|
||||
<form action=<?=$PHP_SELF?> method=POST>
|
||||
<input type=hidden name=refresh_rate value=30>
|
||||
<input type=submit value=RESET(30)>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script language="javascript" type="text/javascript" src="tooltip.js" ></script>
|
||||
<script language=javascript>
|
||||
function showtip(text) {
|
||||
tooltip.innerText=text;
|
||||
tooltip.style.display="inline";
|
||||
}
|
||||
function hidetip() {
|
||||
tooltip.style.display="none";
|
||||
}
|
||||
function movetip() {
|
||||
tooltip.style.pixelTop=event.y+document.body.scrollTop;
|
||||
tooltip.style.pixelLeft=event.x+document.body.scrollLeft+10;
|
||||
}
|
||||
document.onmousemove=movetip;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<META http-equiv="refresh" content="<?=$refresh_rate?>; url=<?=$PHP_SELF?>?refresh_rate=<?=$refresh_rate?>">
|
||||
<?
|
||||
########
|
||||
#CLASSES
|
||||
########
|
||||
class parsePipe {
|
||||
var $tot_line;
|
||||
|
||||
function parseIt($givenText){
|
||||
$cnt = 0;
|
||||
$minValue = 0;
|
||||
$maxValue = 0;
|
||||
$tmp_arr = array();
|
||||
$temp_arr = explode("\r\n", $givenText);
|
||||
$result_arr[$i][9] = "";
|
||||
$this->tot_line = count($temp_arr) == 1 ? 0 : count($temp_arr);
|
||||
for($i=0; $i < $this->tot_line; $i++){
|
||||
if($temp_arr[$i]!='') {
|
||||
$result_arr[$i] = explode("|", $temp_arr[$i]);
|
||||
$result_arr[$i][10] = "";
|
||||
$tmp_arr[$i] = ($result_arr[$i][9] == '' || $result_arr[$i][9] == '-') ? 0 : $this->nullTrim($result_arr[$i][9]);
|
||||
$result_arr[$i][8] = $this->nullTrim($result_arr[$i][8]);
|
||||
$result_arr[$i][9] = $this->nullTrim($result_arr[$i][9]);
|
||||
$result_arr[$i][10] = $this->nullTrim($result_arr[$i][10]);
|
||||
|
||||
if($result_arr[$i][9] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
|
||||
if($cnt == 0) {
|
||||
$minValue = $result_arr[$i][9];
|
||||
$cnt++;
|
||||
}
|
||||
if($minValue > $result_arr[$i][9]) {
|
||||
$minValue = $result_arr[$i][9];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cnt = 0;
|
||||
arsort($tmp_arr);
|
||||
reset($tmp_arr);
|
||||
|
||||
while (list ($key, $val) = each ($tmp_arr)) {
|
||||
//echo "$key = $val<br>";
|
||||
if($val != 0) {
|
||||
if($cnt == 0) {
|
||||
$maxValue = $val;
|
||||
$result_arr[$key][10] = "99FFFF";
|
||||
$cnt++;
|
||||
} else {
|
||||
//if($minValue == $val) {
|
||||
if($val < (2 * 1024 * 1024 * 1024 * 10)) {
|
||||
$result_arr[$key][10] = "red";
|
||||
}else if(($maxValue - $val) < (1024 * 1024 * 1024)) {
|
||||
//echo "1GB Highed<br>";
|
||||
$result_arr[$key][10] = "99FFFF";
|
||||
} else {
|
||||
//echo "1GB Lowed<br>";
|
||||
$result_arr[$key][10] = "yellow";//$maxValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result_arr[$key][10] = "white";
|
||||
}
|
||||
}
|
||||
return $result_arr;
|
||||
}
|
||||
|
||||
function countIt(){
|
||||
return $this->tot_line;
|
||||
}
|
||||
|
||||
function translateIt($parsedText, $type){
|
||||
if($parsedText == '') return;
|
||||
|
||||
$eServerType = array('WWW', 'RTS', 'UISSD', 'CCDB', 'RCTS', 'GTS', "RCDB");
|
||||
/*$eStatus = array('<img src=images/bu16.gif width=11 height=11>UNKNOWN',
|
||||
'<img src=images/bu14.gif width=11 height=11>ALIVE',
|
||||
'<img src=images/bu15.gif width=11 height=11>DEAD');*/
|
||||
$eStatus = array('<img src=images/bu16.gif width=11 height=11>UNKNOWN',
|
||||
'<img src=images/bu14.gif width=11 height=11>',
|
||||
'<img src=images/bu15.gif width=11 height=11>');
|
||||
$eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD');
|
||||
switch($type){
|
||||
case 0:
|
||||
return $eServerType[$parsedText];
|
||||
case 1:
|
||||
return $eStatus[$parsedText];
|
||||
case 2:
|
||||
return $eStatusChar[$parsedText];
|
||||
case 8:
|
||||
if(trim($parsedText) == "-") return "-";
|
||||
else return sprintf("%.2lfG", (trim($parsedText) / 1024) / 1024 / 1024);
|
||||
case 9:
|
||||
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
|
||||
else {
|
||||
if (trim($parsedText) / 1024 / 1024 / 1024 > 1024) {
|
||||
return sprintf("%.2fT", trim($parsedText) / 1024 / 1024 / 1024 / 1024);
|
||||
} else
|
||||
return sprintf("%.2fG", trim($parsedText) / 1024 / 1024 / 1024);
|
||||
}
|
||||
default:
|
||||
return $parsedText;
|
||||
}
|
||||
}
|
||||
|
||||
function nullTrim($tmp_str)
|
||||
{
|
||||
$return_str = "";
|
||||
$maxLength = strlen($tmp_str);
|
||||
|
||||
for($i=0 ; $i < $maxLength ; $i++) {
|
||||
if(ord(substr($tmp_str, $i, 1)) != 0) {
|
||||
$return_str .= substr($tmp_str, $i, 1);
|
||||
}
|
||||
}
|
||||
return $return_str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user