This commit is contained in:
biosvos
2026-08-07 17:38:18 +09:00
commit 873193a243
9613 changed files with 2755992 additions and 0 deletions
@@ -0,0 +1,8 @@
AuthName 'ICS SERVICE STATUS -CC'
AuthType Basic
AuthUserFile /user2/service/wwwroot/controller_server_monitor/status/.htpasswd
AuthGroupFile /dev/null
ErrorDocument 401 'Sorry, check your e-mail'
<Limit GET POST>
require valid-user
</Limit>
@@ -0,0 +1 @@
aion:OKh1UVvzLrz2s
@@ -0,0 +1,377 @@
<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"/>
<? require "layer.js";?>
<script language="javascript1.2" type="text/javascript" src="clock.js" ></script>
<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>
</head>
<body onLoad="UpdateClocks()">
<link rel="stylesheet" href="clockstyle.css" type="text/css">
<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>
<?php
$monitor_member = array("OP ROOM"=>"031-781-0399",
"강명균"=>"016-574-5625",
"최현선(주중야간)"=>"011-365-0370",
"박성우(주중야간)"=>"011-9953-7630",
"김기백(주중주간)"=>"017-608-2385",
"김동민(주말야간)"=>"011-9719-8899",
"김경완"=>"011-9279-1325, 010-2800-1325",
"박정제"=>"011-9737-1955, 02-805-1955",
"강중권"=>"011-745-4849, 02-868-6378",
"임상현"=>"019-376-1236, 010-3337-1236",
"박상용"=>"011-9776-8839",
"배상범"=>"010-4613-8795, 010-4631-8795");
?>
<table border="0" cellspacing="1" width="530" align="center">
<tr align="center">
<td> <h3>######## SYSTEM-HOSTING SERVICE STATUS ########</h3></td>
</tr>
</table>
<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>
<marquee id="tooltip" name="tooltip"></marquee>
<?
$server_addr[0][0] = "127.0.0.1";
$server_addr[0][1] = "30002";
$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, 1024);
$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]?>,&nbsp;&nbsp; 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;
for($j=0; $j<$tot_tr; $j++){
$alt_str = "[$j]".
" [SERVER STATUS] : ".$pt->translateIt($result[$j][0], 2).
" [SERVER NAME] : ".$pt->translateIt($result[$j][2],2).
" [SERVER IP] : ".$pt->translateIt($result[$j][3],3).
" [SERVER PORT] : ".$pt->translateIt($result[$j][4],4);
$totalDisk += $result[$j][8];
$freeDisk += $result[$j][9];
$usedDisk += ($result[$j][8] - $result[$j][9]);
?>
<span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();">
<tr>
<td>(<?=$pt->translateIt($result[$j][0],1)?>&nbsp;<?=$pt->translateIt($result[$j][1],0)?>)&nbsp;<?=$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 echo $pt->translateIt($result[$j][8]-$result[$j][9], 9);
?>
</td>
</tr>
</span>
<?
}
?>
<tr>
<td align="center" colspan="6"><b>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>
<form action=<?=$PHP_SELF?> method=POST>
Refresh Rate :
<input type=text name=refresh_rate value=<?=$refresh_rate?>>
<input type=submit value=SET>
(MIN : 1, MAX : 1000)
</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;
}
}
?>
@@ -0,0 +1,176 @@
<?php
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/pgsql.inc");
if(getenv("REQUEST_METHOD") != "POST")
{
?>
<html>
<head>
<title></title>
<script language='javascript'>
function chkForm()
{
frm = document.info;
if(frm.group_id.value == '')
{
alert('그룹아이디를 입력하세요!');
return;
}
if(frm.group_name.value == '')
{
alert('그룹명을 입력하세요!');
return;
}
if(frm.group_password.value == '' || frm.group_password_confirm.value == '')
{
alert('비밀번호를 입력하세요!');
return;
}
if(frm.group_name.value != frm.group_password_confirm.value)
{
alert('비밀번호를 확인 하십시오!');
return;
}
frm.submit();
}
</script>
</head>
<body>
<form name='info' method='POST' action='./add_group.html'>
<table>
<tr>
<td>&nbsp;그룹ID</td>
<td><input name='group_id' maxlength='20'></td>
</tr>
<tr>
<td>&nbsp;그룹명</td>
<td><input name='group_name' maxlength='20'></td>
</tr>
<tr>
<td>&nbsp;패스워드</td>
<td><input type="password" name='group_password' maxlength='20'></td>
</tr>
<tr>
<td>&nbsp;패스워드확인</td>
<td><input type="password" name='group_password_confirm' maxlength='20'></td>
</tr>
<tr>
<td colspan='2'>
<div align='right'><a href='javascript:history.back(-1)'>뒤로</a>&nbsp;<a href='javascript:chkForm();'>추가</a></div>
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
}else if(getenv("REQUEST_METHOD") == "POST")
{
$group_id = trim($_POST['group_id']);
$group_name = trim($_POST['group_name']);
$group_password = trim($_POST['group_password']);
$group_password_confirm = trim($_POST['group_password_confirm']);
if($group_id != "" && $group_name != "" && ($group_password == $group_password_confirm))
{
$objConn = new DB_Sql;
$enCoding = "set client_encoding = 'uhc'";
$objConn->query($enCoding);
$strSql = "SELECT COUNT(group_seq) AS cnt ";
$strSql .= "FROM t_group ";
$strSql .= "WHERE group_id = '".$group_id."' AND deleted_yn = 'N' ";
$objConn->query($strSql);
if($objConn->nf() != 0)
{
$objConn->next_record();
$cnt = $objConn->f("cnt");
if($cnt == 0)
{
$strSql = "INSERT INTO t_group(group_id, group_password, group_name, deleted_yn, ";
$strSql .= " reg_datetime, update_datetime) ";
$strSql .= "VALUES ('".$group_id."', '".$group_password."', '".$group_name."', 'N', now(), now())";
$objConn->query($strSql);
echo "<script language='javascript'>\n";
echo " alert('등록되었습니다.');\n";
echo " location.href = './group_list.html';\n";
echo "</script>";
}else
{
echo "<script language='javascript'>\n";
echo " alert('그룹이 존재합니다.');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
}else
{
echo "<script language='javascript'>\n";
echo " alert('잘못된 접근입니다.');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
}else
{
echo "<script language='javascript'>\n";
echo " alert('잘못된 접근입니다.');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
}
die;
/*
$group_seq = trim($_POST['group']);
$member_name = trim($_POST['member_name']);
$member_cellphone = trim(str_replace("-", "", $_POST['member_cellphone']));
$strSql = "SELECT COUNT(group_seq) AS cnt ";
$strSql .= "FROM t_group_member ";
$strSql .= "WHERE group_seq = ".$group_seq." AND member_cellphone = '".$member_cellphone."'";
$objConn->query($strSql);
if($objConn->nf() != 0)
{
$objConn->next_record();
$cnt = $objConn->f("cnt");
if($cnt == 0)
{
$strSql = "INSERT INTO t_group_member(group_seq, member_name, member_cellphone, reg_datetime, update_datetime) ";
$strSql .= "VALUES (".$group_seq.", '".$member_name."', '".$member_cellphone."', now(), now())";
$objConn->query($strSql);
echo "<script language='javascript'>\n";
echo " alert('등록되었습니다.');\n";
echo " location.href = './group_list.html';\n";
echo "</script>";
}else
{
echo "<script language='javascript'>\n";
echo " alert('이미 등록되었습니다.');\n";
echo " history.back(-1);\n";
echo "</script>";
}
}
}
}else
{
echo "<script language='javascript'>\n";
echo " alert('잘못된 접근입니다..');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
*/
?>
@@ -0,0 +1,101 @@
<?php
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/pgsql.inc");
$group_seq = isset($_GET['group']) ? $_GET['group'] : $_POST['group'];
if($group_seq != "")
{
$objConn = new DB_Sql;
$enCoding = "set client_encoding = 'uhc'";
$objConn->query($enCoding);
if(getenv("REQUEST_METHOD") == "GET")
{
?>
<html>
<head>
<title></title>
<script language='javascript'>
function chkForm()
{
frm = document.info;
if(frm.member_name.value == '')
{
alert('이름을 입력하세요!');
return;
}
if(frm.member_cellphone.value == "")
{
alert('핸드폰번호를 입력하세요!');
return;
}
frm.submit();
}
</script>
</head>
<body>
<form name='info' method='POST' action='./add_member.html'>
<table>
<tr>
<td>&nbsp;이름</td>
<td><input name='member_name' maxlength='20'></td>
</tr>
<tr>
<td>&nbsp;핸드폰</td>
<td><input name='member_cellphone' maxlength='15'></td>
</tr>
<tr>
<td colspan='2'>
<input type='hidden' name='group' value='<?= $group_seq ?>'>
<div align='right'><a href='javascript:history.back(-1)'>뒤로</a>&nbsp;<a href='javascript:chkForm();'>추가</a></div>
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
}else if(getenv("REQUEST_METHOD") == "POST")
{
$group_seq = trim($_POST['group']);
$member_name = trim($_POST['member_name']);
$member_cellphone = trim(str_replace("-", "", $_POST['member_cellphone']));
$strSql = "SELECT COUNT(group_seq) AS cnt ";
$strSql .= "FROM t_group_member ";
$strSql .= "WHERE group_seq = ".$group_seq." AND member_cellphone = '".$member_cellphone."'";
$objConn->query($strSql);
if($objConn->nf() != 0)
{
$objConn->next_record();
$cnt = $objConn->f("cnt");
if($cnt == 0)
{
$strSql = "INSERT INTO t_group_member(group_seq, member_name, member_cellphone, reg_datetime, update_datetime) ";
$strSql .= "VALUES (".$group_seq.", '".$member_name."', '".$member_cellphone."', now(), now())";
$objConn->query($strSql);
echo "<script language='javascript'>\n";
echo " alert('등록되었습니다.');\n";
echo " location.href = './group_list.html';\n";
echo "</script>";
}else
{
echo "<script language='javascript'>\n";
echo " alert('이미 등록되었습니다.');\n";
echo " history.back(-1);\n";
echo "</script>";
}
}
}
}else
{
echo "<script language='javascript'>\n";
echo " alert('잘못된 접근입니다..');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
?>
@@ -0,0 +1,292 @@
// Removes leading and trailing spaces from the passed string. Also removes
// consecutive spaces and replaces it with one space. If something besides
// a string is passed in (null, custom object, etc.) then return the input.
function trimString(inputString) {
if (typeof inputString != "string") {
return inputString;
}
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") {
// Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) {
// Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+ 1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
}
// Ends the "trim" function
function idnKeyboard(url)
{
myPopupWin= window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=818,height=350');
myPopupWin.focus();
}
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+args[i+2]+args[i+3]+args[i+4]+"'");
}
function submitRequest(url)
{
self.opener.location.href=url;
self.opener.document.submit();
}
function setGainingRegIDValue(selectedform, selectedRegID ) {
selectedRegID.value = selectedform.regID.options[selectedform.regID.selectedIndex].value;
}
function PopWin(myUrl, arg1, arg2, arg3, width, height,resizable)
{
var url=myUrl+arg1+arg2+arg3;
myPopupWin = window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=700', copyhistory=0);
myPopupWin.focus();
}
function appendValues(nameObj)
{
if (isEmpty(nameObj.value) ) return;
appendOptionToSelectBox(window.document.form1.userNameList,
nameObj.value, false);
}
function appendNVPair(nameObj, valueObj)
{
if (isEmpty(nameObj.value) ) return;
if (isEmpty(valueObj.value) ) return;
str = nameObj.value + "=" + valueObj.value;
appendOptionToSelectBox(window.document.form1.userNameList, str, false);
}
function appendContPairs(nameObj, valueObj)
{
if (isEmpty(nameObj.value) ) return;
if (isEmpty(valueObj.value) ) return;
str = nameObj.value + "=" + valueObj.value;
appendOptionToSelectBox(window.document.form1.regContList, str, false);
}
function appendIPAdressValue(nameObj, valueObj)
{
if (isEmpty(nameObj.value) ) return;
if (isEmpty(valueObj.value) ) return;
str = nameObj.value + "=" + valueObj.value;
appendOptionToSelectBox(window.document.form1.nsIplist, str, false);
}
function removeNVPair()
{
if(window.document.form1.userNameList.selectedIndex >=0 ){
//removeOptionSelected(window.document.form1.userValueList);
removeOptionSelected(window.document.form1.userNameList);
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function validateIP(theIP,theField, formCxt)
{
if( !isValidIPV4(theIP) ) {
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function setRegIDValue(selectedRegID ) {
selectedRegID.value = window.document.query.regID.options[window.document.query.regID.selectedIndex].value;
}
var timerID ;
function tzone(tz, os, ds, cl)
{
this.ct = new Date(0) ; // datetime
this.tz = tz ; // code
this.os = os ; // GMT offset
this.ds = ds ; // has daylight savings
this.cl = cl ; // font color
}
function UpdateClocks()
{
// www.timeanddate.com/worldclock
var ct = new Array(
new tzone('UTC: ', 0, 1, '#FFAA00'),
new tzone('KST: ', +9, 1, '#FFAA00'),
new tzone('EST: ', -5, 1, '#FFAA00'),
new tzone('GMT: ', 0, 1, '#FFAA00'),
new tzone('C N : ', +8, 0, 'silver'),
new tzone('KST: ', +9, 0, 'silver'),
new tzone('EDT: ', -4, 1, 'silver'),
new tzone('GER: ', +1, 1, 'silver')
) ;
var dt = new Date() ; // [GMT] time according to machine clock
var startDST = new Date(dt.getFullYear(), 3, 1) ;
while (startDST.getDay() != 0)
startDST.setDate(startDST.getDate() + 1) ;
var endDST = new Date(dt.getFullYear(), 9, 31) ;
while (endDST.getDay() != 0)
endDST.setDate(endDST.getDate() - 1) ;
var ds_active ; // DS currently active
if (startDST < dt && dt < endDST)
ds_active = 1 ;
else
ds_active = 0 ;
// Adjust each clock offset if that clock has DS and in DS.
for(n=0 ; n<ct.length ; n++)
if (ct[n].ds == 1 && ds_active == 1) ct[n].os++ ;
// compensate time zones
gmdt = new Date() ;
for (n=0 ; n<ct.length ; n++)
ct[n].ct = new Date(gmdt.getTime() + ct[n].os * 3600 * 1000) ;
window.document.getElementById("Clock0").innerHTML = '<font color="' + ct[0].cl + '">' + ct[0].tz + ClockString(ct[0].ct) + '</font>' ;
window.document.getElementById("Clock1").innerHTML = '<font color="' + ct[1].cl + '">' + ct[1].tz + ClockString(ct[1].ct) + '</font>' ;
window.document.getElementById("Clock2").innerHTML = '<font color="' + ct[2].cl + '">' + ct[2].tz + ClockString(ct[2].ct) + '</font>' ;
window.document.getElementById("Clock3").innerHTML = '<font color="' + ct[3].cl + '">' + ct[3].tz + ClockString(ct[3].ct) + '</font>' ;
window.document.getElementById("Clock4").innerHTML = '<font color="' + ct[4].cl + '">' + ct[4].tz + ClockString(ct[4].ct) + '</font>' ;
window.document.getElementById("Clock5").innerHTML = '<font color="' + ct[5].cl + '">' + ct[5].tz + ClockString(ct[5].ct) + '</font>' ;
window.document.getElementById("Clock6").innerHTML = '<font color="' + ct[6].cl + '">' + ct[6].tz + ClockString(ct[6].ct) + '</font>' ;
window.document.getElementById("Clock7").innerHTML = '<font color="' + ct[7].cl + '">' + ct[7].tz + ClockString(ct[7].ct) + '</font>' ;
timerID = window.setTimeout("UpdateClocks()", 1001) ;
}
function ClockString(dt)
{
var stemp, ampm ;
var dt_year = dt.getUTCFullYear() ;
var dt_month = dt.getUTCMonth() + 1 ;
var dt_day = dt.getUTCDate() ;
var dt_hour = dt.getUTCHours() ;
var dt_minute = dt.getUTCMinutes() ;
var dt_second = dt.getUTCSeconds() ;
dt_year = dt_year.toString() ;
if (0 <= dt_hour && dt_hour < 12)
{
ampm = 'AM' ;
// if (dt_hour == 0) dt_hour = 12 ;
} else {
ampm = 'PM' ;
// dt_hour = dt_hour - 12 ;
// if (dt_hour == 0) dt_hour = 12 ;
}
if (dt_hour < 10)
dt_hour = '0' + dt_hour ;
if (dt_minute < 10)
dt_minute = '0' + dt_minute ;
if (dt_second < 10)
dt_second = '0' + dt_second ;
//stemp = dt_month + '/' + dt_day + '/' + dt_year.substr(2,2) ;
stemp = dt_year + '/' + dt_month + '/' + dt_day;
stemp = stemp + ' ' + dt_hour + ":" + dt_minute + ":" + dt_second + ' ' + ampm ;
return stemp ;
}
function goToURL( myUrl, arg1, arg2, arg3 ) {
window.location.href=myUrl+arg1+arg2+arg3;
}
function validateStreet(value, theField, formCxt)
{
if(value.length >= 10) {
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function validateName(value,theField, formCxt )
{
if(value.length > 5) {
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function validateEmail(email, theField, formCxt)
{
if ( ! isValidEmail(email) ){
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function selectNVPair(nameObj, valueObj, nvplistObj)
{
nm = nameObj;
val = valueObj;
ix = nvplistObj.selectedIndex;
if(ix < 0 ) return;
nm.value = userNVPList.getName(ix);
val.value = userNVPList.getValue(ix);
val.focus();
}
//Name server add and delete functions
function addNS(nslistObj,nsObj)
{
appendOptionToSelectBox(nslistObj,nsObj);
}
function removeNS(nslistObj,nsObj)
{
removeOptionFromSelectBox(nslistObj,nsObj);
}
function selectNS(nslistObj,nsObj)
{
selectOption(nslistObj,nsObj);
}
function selectAll(list1, list2, list3)
{
if (list1)
selectList(list1);
if (list2)
selectList(list2);
if (list3)
selectList(list3);
}
@@ -0,0 +1,109 @@
H1 A:link, H2 A:link, H3 A:link, H4 A:link, H5 A:link, H6 A:link,
H1 A:visited, H2 A:visited, H3 A:visited, H4 A:visited, H5 A:visited, H6 A:visited
{color: #000;}
.ratBodyText
{ font-family: arial, helvetica, sans-serif; }
.ratBodyText
{ font-size: 12px; }
A:link
{ color: #000000; }
A:visited
{ color: #000000; }
A:link:hover
{color: #900;}
A:visited:hover
{color: #600;}
.ratBodyText
{ color: #000000; }
BODY {
background-color: #ffffff;
color: #000;
margin: 0px 0px;
}
.ratNav {
background-color: #036;
color: #fff;
}
.ratNav A:link, .ratNav A:visited { color: #fff; }
.ratNavHighlight A:link, .ratNavHighlight A:visited { color: #fff; }
.ratNavHighlight {
background-color: #c00;
color: #fff;
}
TD{
font-family: Arial,Vernada, Helvetica, sans-serif;
}
.ratNavText {
font-family: µ¸¿òü, Arial, Helvetica, sans-serif;
font-size: 12px;
;font-weight: bold;
line-height: 120%;
padding-left: 0px;
; text-decoration: none
; text-indent: 15pt
}
@@ -0,0 +1,86 @@
<html>
<head>
<title></title>
<script language='javascript'>
function addGroup()
{
location.href = './add_group.html';
}
</script>
<head>
<body>
<?php
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/pgsql.inc");
$objConn = new DB_Sql;
$enCoding = "set client_encoding = 'uhc'";
$objConn->query($enCoding);
$row = 0;
$table = 0;
$strSql = "SELECT a.group_seq, a.group_name, b.member_name, b.member_cellphone ";
$strSql .= "FROM t_group a ";
$strSql .= "LEFT OUTER JOIN t_group_member b ON a.group_seq = b.group_seq ";
$strSql .= "WHERE a.deleted_yn = 'N' ";
$strSql .= "ORDER BY a.group_seq, b.member_name ";
$objConn->query($strSql);
if($objConn->nf() != 0)
{
$chkFirst = 0;
while($objConn->next_record())
{
if($chkFirst == 0) $pre_group_seq = $objConn->f("group_seq");
$group_seq = $objConn->f("group_seq");
if($pre_group_seq != $group_seq)
{
$table++;
$row = 0;
}
$tmpArr[$table][$row][0] = $group_seq;
$tmpArr[$table][$row][1] = $objConn->f("group_name");
$tmpArr[$table][$row][2] = $objConn->f("member_name");
$tmpArr[$table][$row][3] = $objConn->f("member_cellphone");
//echo $table."-".$row."<br>";
//echo $pre_group_seq."-".$group_seq."<br>";
$pre_group_seq = $group_seq;
$row++;
$chkFirst++;
}
echo "<table width='230' border='0'>\n";
echo " <tr>\n";
echo " <td colspan='".($table+1)."'>\n";
echo " <a href='javascript:addGroup();'>그룹추가</a>\n";
echo " </td>\n";
echo " </tr>\n";
for($i=0; $i<($table+1); $i++)
{
if(($i+1)%3 == 0) echo " <tr align='center'>\n";
echo " <td valign='top' height='250'>\n";
echo " <table border='0' width='200'>\n";
echo " <tr>\n";
echo " <td align='center'><b>그룹명#".($i+1)." ".$tmpArr[$i][0][1]."</b></td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " <table border='1' width='200'>\n";
for($j=0; $j<sizeof($tmpArr[$i]); $j++)
{
echo " <tr>\n";
echo " <td width='10' align='center'>".($j+1)."</td>\n";
echo " <td width='80' align='center'><a href='./mod_member.html?group=".$tmpArr[$i][0][0]."&cell=".$tmpArr[$i][$j][3]."'>".$tmpArr[$i][$j][2]."</a></td>\n";
echo " <td width='110'>&nbsp;".$tmpArr[$i][$j][3]."</td>\n";
echo " </tr>\n";
}
echo " </table>\n";
echo "<div align='right'><a href='./add_member.html?group=".$tmpArr[$i][0][0]."'>멤버추가</a></div>";
echo " </td>\n";
if(($i+1)%3 == 0) echo " </tr>\n";
}
echo "</table>";
}
?>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

@@ -0,0 +1,581 @@
<?
$explain['222.122.19.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['222.122.69.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['222.122.69.17']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['222.122.69.148']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['222.122.181.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['125.141.215.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['121.254.146.5']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['125.141.243.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['121.189.28.5']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['121.189.28.10']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['121.189.28.140']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['175.117.147.8']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$serviceType = isset($_GET['service_type']) ? $_GET['service_type'] : $_POST['service_type'];
if($serviceType == "") $serviceType = 3;
//serviceType : the order described in conf file. --_-;
$width = isset($_GET['width']) ? $_GET['width'] : $_POST['width'];
if ( $width == "" ) $width=800;
header("Content-type: text/html; charset=euc-kr");
?>
<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:580;
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> -->
</head>
<!-- <body onLoad="UpdateClocks()"> -->
<body>
<form name="frm" action=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType ?>">
<!--
<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" valign="center">
<td> <h3>######## 제어 서버 모니터링 ########</h3></td>
<td>
<!--
<img src="images/bu14.gif" width=11 height=11>norm&nbsp;&nbsp;
<img src="images/bu77.gif" width=11 height=11>nomon&nbsp;&nbsp;
<img src="images/bu15.gif" width=11 height=11>fail&nbsp;&nbsp;
//-->
<button onclick=marqueeObj.start()>START</button>
<button onclick=marqueeObj.stop()>STOP</button>
</td>
</tr>
</table>
<div id="tooltip" name="tooltip" width=530></div>
<?
/* <marquee id="tooltip" name="tooltip"></marquee>*/
$server_addr[0][0] = "127.0.0.1";
$server_addr[0][1] = "30002";
$server_addr[0][2] = "KT-IDC";
$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);
if($j < 1024) break;
}
fclose($fp);
}
//echo "\n<!-- TEST:\n$test\n-->\n";
?>
<td valign=top>
<?
$pt = new parsePipe();
$test = $pt->nullTrim($test);
$tmpArr = $pt->textArr($test);
$serviceName = $pt->serviceName($test);
$result = $pt->parseIt($tmpArr[$serviceType]);
$tot_tr = $pt->countIt();
?>
<!-- <marquee direction=up infinite behavior="scroll" width="800" height="650"> //-->
<marquee id="marqueeObj" behavior="alternate" scrolldelay=200 width=<?=$width?> height=650>
<table border=0>
<tr>
<td>
<table border=0 width=100%>
<tr>
<td>
<table border=0 cellspacing=0 width=100%>
<tr>
<td bgcolor='618FFC' align='center'>0%</td>
<td bgcolor='ADC900' align='center'>10%</td>
<td bgcolor='FEBC00' align='center'>20%</td>
<td bgcolor='F2685E' align='center'>30%</td>
<td bgcolor='618FFC' align='center'>40%</td>
<td bgcolor='ADC900' align='center'>50%</td>
<td bgcolor='FEBC00' align='center'>60%</td>
<td bgcolor='F2685E' align='center'>70%</td>
<td bgcolor='618FFC' align='center'>80%</td>
<td bgcolor='ADC900' align='center'>90%</td>
<td bgcolor='FEBC00' align='center'>100%</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border=0 blcolor=yellow>
<tr>
<td>
<table border=0>
<tr>
<td>
</td>
</tr>
<?
for($j=0; $j<$tot_tr; $j++){
if (strrpos($pt->tailer($result[$j][2]), "^") == false)
$servName = $pt->tailer($result[$j][2]);
else
$servName = substr($pt->tailer($result[$j][2]), 0, strrpos($pt->tailer($result[$j][2]), "^"));
$partrc=explode("-", $servName);
$rcname="$partrc[0]$partrc[1]";
#echo "rcname = $rcname | rcname1 = $rcname1";
if ( $rcname != $rcname1 ) { ## 절반 나누어서 옆테이블로 구성
echo "</table>";
echo "</td>";
echo "<td valign=top>";
echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor='b2b2b2'>";
echo "<tr>";
echo "<td bgcolor='efefef'><center><b><font color='#000066'>Name</font></b></center></td>";
echo "<td bgcolor='efefef'><center><b><font color='#000066'>Server IP</font></b></center></td>";
echo "<td bgcolor='efefef'><center><b><font color='#000066'>Port</font></b></center></td>";
#echo "<td bgcolor='efefef'><center><b><font color='#000066'>Etc</font></b></center</td>";
echo "</tr>";
}
$rcname1=$rcname;
?>
<!-- <span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();"> //-->
<tr>
<?
switch($result[$j][0])
{
case 2 :
$bgcolor = 'red';
/*
$font_servName = "<font color='red'><b>".$servName."</b></font>";
$font_servIp = "<font color='red'><b>".$result[$j][3]."</b></font>";
$font_servPort = "<font color='red'><b>".$pt->translateIt($result[$j][4],4)."</b></font>";
*/
break;
case 1 :
$bgcolor = 'white';
/*
$font_servName = $servName;
$font_servIp = $result[$j][3];
$font_servPort = $pt->translateIt($result[$j][4],4);
*/
break;
default :
$bgcolor = 'white';
/*
$font_servName = $servName;
$font_servIp = $result[$j][3];
$font_servPort = $pt->translateIt($result[$j][4],4);
*/
break;
}
?>
<td bgcolor=<?=$bgcolor?> nowrap><?=$pt->translateIt($result[$j][0],1)?>&nbsp;&nbsp; <?=$servName?></td>
<td bgcolor=<?=$bgcolor?> align="center"><?=$result[$j][3]?></td>
<td bgcolor=<?=$bgcolor?> align="center"><?=$pt->translateIt($result[$j][4],4)?></td>
<!-- Etc
<td bgcolor=<?=$bgcolor?>><?=$explain[$result[$j][3]][$pt->translateIt($result[$j][4],4)]?></td>
//-->
</tr>
<!-- </span> //-->
<?
}
?>
</td>
</tr>
</table>
</table>
</marquee>
</td>
<?
if($i%3 == 2) echo "</table></tr>"; //
}
?>
<table>
</table>
<?
////////////////////
//Print REFRESHER
////////////////////
extract($_POST);
$refresh_rate = $_REQUEST['refresh_rate'];
$width = $_REQUEST['width'];
if($refresh_rate<1 || $refresh_rate>1000)
$refresh_rate = 60;
if ( $width == '')
$width = 800;
?>
<br>
<table align="center">
<tr>
<td>
Refresh Rate(1~1000) :
<input type=text name=refresh_rate width=100 value=<?=$refresh_rate?>>
Roll Size(default:800) :
<input type=text name=width value=<?=$width?>>
<input type=submit value=SET>
<input type="hidden" name="chk" value="0">
</form>
</td>
<td align=right>
<form action=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType?>">
<input type=hidden name=refresh_rate value=60>
<input type=hidden name=width value=800>
<input type=submit value='RESET(60sec, 800px)'>
</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?>&service_type=<?=$serviceType?>&width=<?=$width?>">
<?
########
#CLASSES
########
class parsePipe {
var $tot_line;
function parseIt($givenText){
$cnt = 0;
$minValue = 0;
$maxValue = 0;
$minLevel = 1000;
$tmp_arr = array();
$temp_arr = explode("\r\n", $givenText);
$result_arr[$i][9] = "";
$this->tot_line = count($temp_arr) == 1 ? 0 : count($temp_arr) - 1;
for($i=0; $i < $this->tot_line; $i++){
if($temp_arr[$i]!='') {
$result_arr[$i] = explode("|", $temp_arr[$i]);
$result_arr[$i][20] = "";
$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];
}
}
*/
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
if ($minLevel > $result_arr[$i][11]) {
$minLevel = $result_arr[$i][11];
}
}
}
}
for ($i = 0; $i < $tot_tr; $i++) {
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0 && $result_arr[$i][11] <= $minLevel) {
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];
}
}
}
}
//echo "minLevel $minLevel minValue $minValue<br>";
$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) {
if ($minLevel < $result_arr[$key][11] ||
$result_arr[$key][10] > 0) {
$result_arr[$key][20] = "yellow";//$maxValue;
} else {
//echo "11 ".$result_arr[$key][11]." 10 ".$result_arr[$key][10]."<br>";
$maxValue = $val;
$result_arr[$key][20] = "99FFFF";
$cnt++;
}
} else {
//if($minValue == $val) {
if($val < (2 * 1024 * 1024 * 1024 * 10)) {
$result_arr[$key][20] = "red";
} else if(($maxValue - $val) < (1024 * 1024 * 1024) &&
$minLevel == $result_arr[$key][11]) {
//echo "1GB Highed<br>";
//echo "minLevel $minLevel maxValue $maxValue<br>";
$result_arr[$key][20] = "99FFFF";
} else {
//echo "1GB Lowed<br>";
$result_arr[$key][20] = "yellow";//$maxValue;
}
}
} else {
$result_arr[$key][20] = "white";
}
}
return $result_arr;
}
function countIt(){
return $this->tot_line;
}
function translateIt($parsedText, $type){
if($parsedText == '') return;
$eServerType = array('WWW', 'RTS', 'RC', 'CCDB', 'RCTS', 'GTS', "RCDB");
$eStatus = array('<img src=images/bu16_1.gif width=11 height=11>',
'<img src=images/bu14.gif width=11 height=11>',
'<img src=images/bu15.gif width=11 height=11>',
'<img src=images/bu77.gif width=11 height=11>');
$eStatusUP = array('<img src=images/bu14.gif width=11 height=11>',
'<img src=images/bu16_1.gif width=11 height=11>',
'<img src=images/bu15.gif width=11 height=11>');
$eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD', 'NO MONITORING');
switch($type){
case 0:
return $eServerType[$parsedText];
return '';
case 1:
return $eStatus[$parsedText];
case 2:
return $eStatusChar[$parsedText];
case 3:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("<b>%.2fGB</b>",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
if (trim($parsedText) / 1024 / 1024 > 10) {
return sprintf("<font color=\"blue\"><b>%.2fMB</b></font>",
trim($parsedText) / 1024 / 1024 );
} else {
return sprintf("<b>%.2fMB</b>",
trim($parsedText) / 1024 / 1024 );
}
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fKB",
trim($parsedText) / 1024 );
} else {
return sprintf("%dB",
trim($parsedText));
}
}
}
}
case 8:
if(trim($parsedText) == "-" || $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);
}
case 10:
return $eStatusUP[$parsedText];
case 30:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("%.2fG",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
return sprintf("%.2fM",
trim($parsedText) / 1024 / 1024 );
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fK",
trim($parsedText) / 1024 );
} else {
return sprintf("%d",
trim($parsedText));
}
}
}
}
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 || $tmp_str != " ") {
$return_str .= substr($tmp_str, $i, 1);
}
}
return $return_str;
}
function textArr($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
//$str_arr[$cnt][30] = $search_str[0];
//echo $str_arr[$cnt][0]."<br>".$tmp_search_str."->".$cnt."<-"."<br>";
$cnt++;
}
$str_arr[$cnt] .= $temp_arr[$i]."\r\n";
}
return $str_arr;
}
function serviceName($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
//echo $split_str[0]."<br>";
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
$cnt++;
}
$str_arr[$cnt][0] = $tmp_search_str;
if($split_str[0] == 2) {
$str_arr[$cnt][1] = "dead";
}
// $str_arr[4][1] = "dead";
// $str_arr[1][1] = "dead";
}
return $str_arr;
}
function tailer($name)
{
$temp_arr = explode("_", $name);
$temp_arr2 = substr($name, strlen($temp_arr[0]) + 1, strlen($name));
return $temp_arr2;
}
function noYear($date)
{
$date = substr($date, 5, 14);
return $date;
}
}
?>
@@ -0,0 +1,479 @@
<?
$serviceType = isset($_GET['service_type']) ? $_GET['service_type'] : $_POST['service_type'];
if($serviceType == "") $serviceType = 0;
?>
<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>
<input type="hidden" name="service_type" value="<?= $serviceType ?>">
<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",
"배상범"=>"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";
$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, 1024);
$test .= trim($test2);
$j = strlen($test2);
if($j < 1024) break;
}
fclose($fp);
}
?>
<td valign=top>
<?
$pt = new parsePipe();
$test = $pt->nullTrim($test);
$tmpArr = $pt->textArr($test);
$serviceName = $pt->serviceName($test);
echo $test;
$result = $pt->parseIt($tmpArr[$serviceType]);
$tot_tr = $pt->countIt();
echo " <table border=0 cellpadding=0 cellspacing=0>\n";
echo " <tr>\n";
for($k=0; $k<sizeof($serviceName); $k++) {
echo " <td width='80' height='35'>\n";
echo " <font size='4'>";
echo " <a href='".$PHP_SELF."?service_type=".$k."'>";
if($serviceType==$k) echo "<b>";
echo $serviceName[$k];
if($serviceType==$k) echo "</b>";
echo " </a>";
echo " </font>";
echo " </td>\n";
}
echo " </tr>\n";
echo " </table>\n";
?>
<table border=1 cellpadding=1 cellspacing=0>
<tr height="60">
<td colspan="9">
<center><b>
<font color="#000066" size="5">
<?= $serviceName[$serviceType] ?><br><br>
</font>
<font color="#000066" size="4">
MNG SERVER IP: <?=$server_addr[$i][0]?>,&nbsp;&nbsp; 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;
for($j=0; $j<$tot_tr; $j++){
$alt_str = "[$j]".
" [SERVER STATUS] : ".$pt->translateIt($result[$j][0], 2).
" [SERVER NAME] : ".$pt->translateIt($result[$j][2],2).
" [SERVER IP] : ".$pt->translateIt($result[$j][3],3).
" [SERVER PORT] : ".$pt->translateIt($result[$j][4],4);
$totalDisk += $result[$j][8];
$freeDisk += $result[$j][9];
$usedDisk += ($result[$j][8] - $result[$j][9]);
?>
<span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();">
<tr>
<td>(<?=$pt->translateIt($result[$j][0],1)?>&nbsp;<?=$pt->translateIt($result[$j][1],0)?>)&nbsp;<?=$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] == "-" || $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] == "-" || $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>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="service_type" value="<?= $serviceType?>">
<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?>&service_type=<?= $serviceType ?>">
<?
########
#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) - 1;
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) == "-" || $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)
{
$cnt = 0;
$return_str = "";
//$tmp_str = str_replace("\r\n", "", $tmp_str);
$maxLength = strlen($tmp_str);
for($i=0 ; $i < $maxLength ; $i++) {
$splitStr = substr($tmp_str, $i, 1);
if(ord($splitStr) != 0) {
/*if($splitStr == "|") {
$cnt++;
}*/
$return_str .= substr($tmp_str, $i, 1);
//If(($cnt % 10) == 0) $return_str .= "\r\n";
}
}
return $return_str;
}
function textArr($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
//$str_arr[$cnt][30] = $search_str[0];
//echo $str_arr[$cnt][0]."<br>".$tmp_search_str."->".$cnt."<-"."<br>";
$cnt++;
}
$str_arr[$cnt] .= $temp_arr[$i]."\r\n";
}
return $str_arr;
}
function serviceName($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
$cnt++;
}
$str_arr[$cnt] = $tmp_search_str;
}
return $str_arr;
}
}
?>
@@ -0,0 +1,610 @@
<?
$explain['222.122.19.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['222.122.69.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['222.122.69.17']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['222.122.69.148']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['222.122.181.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['125.141.215.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['121.254.146.5']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['125.141.243.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['121.189.28.5']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$explain['121.189.28.10']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['121.189.28.140']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
$explain['175.117.147.8']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
$serviceType = isset($_GET['service_type']) ? $_GET['service_type'] : $_POST['service_type'];
if($serviceType == "") $serviceType = 3;
//serviceType : the order described in conf file. --_-;
header("Content-type: text/html; charset=euc-kr");
?>
<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:580;
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>
</head>
<body onLoad="UpdateClocks()">
<form name="frm" action=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType ?>">
<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>######## ICS CONTROL STATUS ########</h3></td>
</tr>
</table>
<table border="0" cellspacing="1" width="430" align="center">
<tr align="left">
<td>
<img src="images/bu14.gif" width=11 height=11>norm&nbsp;&nbsp;
<img src="images/bu77.gif" width=11 height=11>nomon&nbsp;&nbsp;
<img src="images/bu15.gif" width=11 height=11>fail&nbsp;&nbsp;
</td>
</tr>
</table>
<div id="tooltip" name="tooltip" width=530></div>
<?
/* <marquee id="tooltip" name="tooltip"></marquee>*/
$server_addr[0][0] = "127.0.0.1";
$server_addr[0][1] = "30002";
$server_addr[0][2] = "KT-IDC";
$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);
if($j < 1024) break;
}
fclose($fp);
}
//echo "\n<!-- TEST:\n$test\n-->\n";
?>
<td valign=top>
<?
$pt = new parsePipe();
$test = $pt->nullTrim($test);
$tmpArr = $pt->textArr($test);
$serviceName = $pt->serviceName($test);
$result = $pt->parseIt($tmpArr[$serviceType]);
$tot_tr = $pt->countIt();
?>
<table border=0 cellpadding=3 cellspacing=1 bgcolor="b2b2b2">
<tr height="60">
<td colspan="4" bgcolor="FFFFFF">
<center><b>
<font color="#000066" size="5">
<? ## modified by nuhonda
if($serviceName[$serviceType][0]=='CCMONITOR')
echo "제어서버 모니터링";
?>
</font>
</b>
</center>
</td>
</tr>
<tr>
<td bgcolor="efefef"><center><b><font color="#000066">Name</font></b></center></td>
<td width="140" bgcolor="efefef"><center><b><font color="#000066">Server IP</font></b></center></td>
<td width="75" bgcolor="efefef"><center><b><font color="#000066">Port</font></b></center></td>
<td bgcolor="efefef"><center><b><font color="#000066">Etc</font></b></center</td>
<!--
<td width="135"><center><b><font color="#000066">Status<br>Changed</font></b></center></td>
<td width="65"><center><b><font color="#000066">Total Disk</font></b></center></td>
<td width="65"><center><b><font color="#000066">Free</font></b></center></td>
<td width="25"><center><b><font color="#000066">Upload</font>
<img src="http://sh.0x31.com/status/images/bu14.gif" width=20 height=20>norm<br>
<img src="http://sh.0x31.com/status/images/bu16_1.gif" width=20 height=20>disb<br>
<img src="http://sh.0x31.com/status/images/bu15.gif" width=20 height=20>fsck<br>
</b>
</center>
</td>
<td width="50"><center><b><font color="#000066">Disk Busy(Lq)</font></b></center></td>
<td width="100"><center><b><font color="#000066">Traffic INB(Packets)</font></b></center></td>
<td width="100"><center><b><font color="#000066">Traffic OUTB(Packets)</font></b></center></td>
<td width="50"><center><b><font color="#000066">Conn EASTAB(TOT)</font></b></center></td>
-->
</tr>
<?
$totalDisk = 0;
$freeDisk = 0;
$usedDisk = 0;
$totalRTSCount = 0;
$totalTrafficINB = 0;
$totalPacketsINB = 0;
$totalTrafficOUTB = 0;
$totalPacketsOUTB = 0;
$totalConnEstab = 0;
$totalConnAll = 0;
for($j=0; $j<$tot_tr; $j++){
//echo $serviceName[2][0];
$add_alt = "";
if (!strcmp($result[$j][20], "99FFFF")) {
$add_alt = " (UPLOAD TARGET)";
} else if ($result[$j][10] == 1) {
$add_alt = " (UPLOAD MANUALLY DISABLED)";
} else if ($result[$j][10] == 2) {
$add_alt = " (FSCK RUNNING)";
} else {
$add_alt = "";
}
$alt_str =
"[NAME] : ".
$result[$j][2].
" [STATUS] : ".
$pt->translateIt($result[$j][0], 2).$add_alt.
" [TYPE] : ".
$pt->translateIt($result[$j][1], 0);
$totalDisk += $result[$j][8];
$freeDisk += $result[$j][9];
$usedDisk += ($result[$j][8] - $result[$j][9]);
if($result[$j][2]=="RC004_RCTS01" || $result[$j][2] == "RC004_RCTS02" || $result[$j][2] == "EVENT_DB01")
{
continue;
}
if($result[$j][2] == "EVENT_DB02" || $result[$j][2] == "EVENT_PGLB01")
{
continue;
}
if ($result[$j][1] == 1) {
$totalRTSCount += 1;
}
/* Packets INB */
if ($result[$j][16] != '-') {
$totalPacketsINB += $result[$j][16];
}
/* Traffic INB */
if ($result[$j][17] != '-') {
$totalTrafficINB += $result[$j][17];
}
/* Packets OUTB */
if ($result[$j][18] != '-') {
$totalPacketsOUTB += $result[$j][18];
}
/* Traffic OUTB */
if ($result[$j][19] != '-') {
$totalTrafficOUTB += $result[$j][19];
}
/* Connection Estblished */
if ($result[$j][14] != '-') {
$totalConnEstab += $result[$j][14];
}
/* Connection All */
if ($result[$j][15] != '-') {
$totalConnAll += $result[$j][15];
}
?>
<span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();">
<tr>
<?
if (strrpos($pt->tailer($result[$j][2]), "^") == false)
$servName = $pt->tailer($result[$j][2]);
else
$servName = substr($pt->tailer($result[$j][2]), 0, strrpos($pt->tailer($result[$j][2]), "^"));
?>
<?
switch($result[$j][0])
{
case 2 :
$bgcolor = 'red';
/*
$font_servName = "<font color='red'><b>".$servName."</b></font>";
$font_servIp = "<font color='red'><b>".$result[$j][3]."</b></font>";
$font_servPort = "<font color='red'><b>".$pt->translateIt($result[$j][4],4)."</b></font>";
*/
break;
case 1 :
$bgcolor = 'white';
/*
$font_servName = $servName;
$font_servIp = $result[$j][3];
$font_servPort = $pt->translateIt($result[$j][4],4);
*/
break;
default :
$bgcolor = 'white';
/*
$font_servName = $servName;
$font_servIp = $result[$j][3];
$font_servPort = $pt->translateIt($result[$j][4],4);
*/
break;
}
?>
<td bgcolor=<?=$bgcolor?>><?=$pt->translateIt($result[$j][0],1)?>&nbsp;&nbsp;<?=$servName?></td>
<td bgcolor=<?=$bgcolor?> align="center"><?=$result[$j][3]?></td>
<td bgcolor=<?=$bgcolor?> align="center"><?=$pt->translateIt($result[$j][4],4)?></td>
<td bgcolor=<?=$bgcolor?>><?=$explain[$result[$j][3]][$pt->translateIt($result[$j][4],4)]?></td>
</tr>
</span>
<?
}
?>
</table></td>
<?
if($i%3 == 2) echo "</table></tr>"; //
}
?>
<table>
</table>
<?
////////////////////
//Print REFRESHER
////////////////////
extract($_POST);
$refresh_rate = $_REQUEST['refresh_rate'];
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=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType?>">
<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?>&service_type=<?= $serviceType ?>">
<?
########
#CLASSES
########
class parsePipe {
var $tot_line;
function parseIt($givenText){
$cnt = 0;
$minValue = 0;
$maxValue = 0;
$minLevel = 1000;
$tmp_arr = array();
$temp_arr = explode("\r\n", $givenText);
$result_arr[$i][9] = "";
$this->tot_line = count($temp_arr) == 1 ? 0 : count($temp_arr) - 1;
for($i=0; $i < $this->tot_line; $i++){
if($temp_arr[$i]!='') {
$result_arr[$i] = explode("|", $temp_arr[$i]);
$result_arr[$i][20] = "";
$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];
}
}
*/
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
if ($minLevel > $result_arr[$i][11]) {
$minLevel = $result_arr[$i][11];
}
}
}
}
for ($i = 0; $i < $tot_tr; $i++) {
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0 && $result_arr[$i][11] <= $minLevel) {
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];
}
}
}
}
//echo "minLevel $minLevel minValue $minValue<br>";
$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) {
if ($minLevel < $result_arr[$key][11] ||
$result_arr[$key][10] > 0) {
$result_arr[$key][20] = "yellow";//$maxValue;
} else {
//echo "11 ".$result_arr[$key][11]." 10 ".$result_arr[$key][10]."<br>";
$maxValue = $val;
$result_arr[$key][20] = "99FFFF";
$cnt++;
}
} else {
//if($minValue == $val) {
if($val < (2 * 1024 * 1024 * 1024 * 10)) {
$result_arr[$key][20] = "red";
} else if(($maxValue - $val) < (1024 * 1024 * 1024) &&
$minLevel == $result_arr[$key][11]) {
//echo "1GB Highed<br>";
//echo "minLevel $minLevel maxValue $maxValue<br>";
$result_arr[$key][20] = "99FFFF";
} else {
//echo "1GB Lowed<br>";
$result_arr[$key][20] = "yellow";//$maxValue;
}
}
} else {
$result_arr[$key][20] = "white";
}
}
return $result_arr;
}
function countIt(){
return $this->tot_line;
}
function translateIt($parsedText, $type){
if($parsedText == '') return;
$eServerType = array('WWW', 'RTS', 'RC', 'CCDB', 'RCTS', 'GTS', "RCDB");
$eStatus = array('<img src=images/bu16_1.gif width=11 height=11>',
'<img src=images/bu14.gif width=11 height=11>',
'<img src=images/bu15.gif width=11 height=11>',
'<img src=images/bu77.gif width=11 height=11>');
$eStatusUP = array('<img src=images/bu14.gif width=11 height=11>',
'<img src=images/bu16_1.gif width=11 height=11>',
'<img src=images/bu15.gif width=11 height=11>');
$eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD', 'NO MONITORING');
switch($type){
case 0:
return $eServerType[$parsedText];
return '';
case 1:
return $eStatus[$parsedText];
case 2:
return $eStatusChar[$parsedText];
case 3:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("<b>%.2fGB</b>",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
if (trim($parsedText) / 1024 / 1024 > 10) {
return sprintf("<font color=\"blue\"><b>%.2fMB</b></font>",
trim($parsedText) / 1024 / 1024 );
} else {
return sprintf("<b>%.2fMB</b>",
trim($parsedText) / 1024 / 1024 );
}
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fKB",
trim($parsedText) / 1024 );
} else {
return sprintf("%dB",
trim($parsedText));
}
}
}
}
case 8:
if(trim($parsedText) == "-" || $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);
}
case 10:
return $eStatusUP[$parsedText];
case 30:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("%.2fG",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
return sprintf("%.2fM",
trim($parsedText) / 1024 / 1024 );
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fK",
trim($parsedText) / 1024 );
} else {
return sprintf("%d",
trim($parsedText));
}
}
}
}
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 || $tmp_str != " ") {
$return_str .= substr($tmp_str, $i, 1);
}
}
return $return_str;
}
function textArr($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
//$str_arr[$cnt][30] = $search_str[0];
//echo $str_arr[$cnt][0]."<br>".$tmp_search_str."->".$cnt."<-"."<br>";
$cnt++;
}
$str_arr[$cnt] .= $temp_arr[$i]."\r\n";
}
return $str_arr;
}
function serviceName($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
//echo $split_str[0]."<br>";
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
$cnt++;
}
$str_arr[$cnt][0] = $tmp_search_str;
if($split_str[0] == 2) {
$str_arr[$cnt][1] = "dead";
}
// $str_arr[4][1] = "dead";
// $str_arr[1][1] = "dead";
}
return $str_arr;
}
function tailer($name)
{
$temp_arr = explode("_", $name);
$temp_arr2 = substr($name, strlen($temp_arr[0]) + 1, strlen($name));
return $temp_arr2;
}
function noYear($date)
{
$date = substr($date, 5, 14);
return $date;
}
}
?>
@@ -0,0 +1,13 @@
<?php
$explain['222.122.19.7']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['222.122.69.7']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['222.122.69.17']['40004'] = '[½ºÆ®¸®¹Ö]FHS error event¸¦ GTS·Î Àü´Þ';
$explain['222.122.69.148']['40004'] = '[½ºÆ®¸®¹Ö]FHS error event¸¦ GTS·Î Àü´Þ';
$explain['222.122.181.7']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['125.141.215.7']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['121.254.146.5']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['125.141.243.7']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['121.189.28.5']['30000'] = '±âµ¿ÁßÀÎ ¼­¹öÀÇ Active/Standby »óŰªÀ» °áÁ¤ÇÔ.';
$explain['121.189.28.10']['40004'] = '[½ºÆ®¸®¹Ö]FHS error event¸¦ GTS·Î Àü´Þ';
$explain['121.189.28.140']['40004'] = '[½ºÆ®¸®¹Ö]FHS error event¸¦ GTS·Î Àü´Þ';
?>
@@ -0,0 +1,133 @@
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v4.01
//Copyright 1998 Macromedia, Inc. All rights reserved.
var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all,NS4=document.layers;
var NS6=(!IE&&document.getElementById), NS=(NS4||NS6); if (!IE && !NS) return false;
retVal = true; if(IE && event) event.returnValue = true;
if (MM_dragLayer.arguments.length > 1) {
curDrag = MM_findObj(objName); if (!curDrag) return false;
if (!document.allLayers) { document.allLayers = new Array();
with (document) if (NS4) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
} else {
if (NS6) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div");
for (i=0;i<spns.length;i++) if (spns[i].style&&spns[i].style.position) allLayers[allLayers.length]=spns[i];}
for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i];
} }
curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
curDrag.MM_oldZ = (NS4)?curDrag.zIndex:curDrag.style.zIndex;
curLeft= (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
} else {
var theEvent = ((NS)?objName.type:event.type);
if (theEvent == 'mousedown') {
var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
var maxDragZ=null; document.MM_maxZ = 0;
for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
var aLayerZ = (NS4)?aLayer.zIndex:parseInt(aLayer.style.zIndex);
if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
var isVisible = (((NS4)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
var parentL=0; var parentT=0;
if (NS6) { parentLayer = aLayer.parentNode;
while (parentLayer != null && parentLayer.style.position) {
parentL += parseInt(parentLayer.offsetLeft); parentT += parseInt(parentLayer.offsetTop);
parentLayer = parentLayer.parentNode;
} } else if (IE) { parentLayer = aLayer.parentElement;
while (parentLayer != null && parentLayer.style.position) {
parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
parentLayer = parentLayer.parentElement; } }
var tmpX=mouseX-(((NS4)?pageX:((NS6)?parseInt(style.left):style.pixelLeft)+parentL)+MM_hLeft);
var tmpY=mouseY-(((NS4)?pageY:((NS6)?parseInt(style.top):style.pixelTop) +parentT)+MM_hTop);
if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
var tmpW = MM_hWidth; if (tmpW <= 0) tmpW += ((NS4)?clip.width :offsetWidth);
var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS4)?clip.height:offsetHeight);
if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
|| maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
if (curDrag) {
document.onmousemove = MM_dragLayer; if (NS4) document.captureEvents(Event.MOUSEMOVE);
curLeft = (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
document.MM_curDrag = curDrag; curDrag.MM_SNAPPED=false;
if(curDrag.MM_toFront) {
eval('curDrag.'+((NS4)?'':'style.')+'zIndex=document.MM_maxZ+1');
if (!curDrag.MM_dropBack) document.MM_maxZ++; }
retVal = false; if(!NS4&&!NS6) event.returnValue = false;
} } else if (theEvent == 'mousemove') {
if (document.MM_curDrag) with (document.MM_curDrag) {
var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
newLeft = mouseX-MM_oldX; newTop = mouseY-MM_oldY;
if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
if (MM_bT!=null) newTop = Math.max(newTop ,MM_bT);
if (MM_bB!=null) newTop = Math.min(newTop ,MM_bB);
MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
if (NS4) {left = newLeft; top = newTop;}
else if (NS6){style.left = newLeft; style.top = newTop;}
else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
if (MM_dragJS) eval(MM_dragJS);
retVal = false; if(!NS) event.returnValue = false;
} } else if (theEvent == 'mouseup') {
document.onmousemove = null;
if (NS) document.releaseEvents(Event.MOUSEMOVE);
if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
if (document.MM_curDrag) with (document.MM_curDrag) {
if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
(Math.pow(MM_targL-((NS4)?left:(NS6)?parseInt(style.left):style.pixelLeft),2)+
Math.pow(MM_targT-((NS4)?top:(NS6)?parseInt(style.top):style.pixelTop),2))<=MM_tol) {
if (NS4) {left = MM_targL; top = MM_targT;}
else if (NS6) {style.left = MM_targL; style.top = MM_targT;}
else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
if(MM_dropBack) {if (NS4) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
retVal = false; if(!NS) event.returnValue = false; }
document.MM_curDrag = null;
}
if (NS) document.routeEvent(objName);
} return retVal;
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
@@ -0,0 +1,148 @@
<?php
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/pgsql.inc");
$group_seq = isset($_GET['group']) ? $_GET['group'] : $_POST['group'];
$member_cellphone = isset($_GET['cell']) ? $_GET['cell'] : $_POST['member_cellphone'];
if($member_cellphone != "" && $group_seq != "")
{
$objConn = new DB_Sql;
$enCoding = "set client_encoding = 'uhc'";
$objConn->query($enCoding);
if(getenv("REQUEST_METHOD") == "GET")
{
$strSql = "SELECT member_name, member_cellphone ";
$strSql .= "FROM t_group_member ";
$strSql .= "WHERE group_seq = ".$group_seq." AND member_cellphone = '".$member_cellphone."'";
$objConn->query($strSql);
if($objConn->nf() == 1)
{
$objConn->next_record();
$member_name = $objConn->f("member_name");
$member_cellphone = $objConn->f("member_cellphone");
}else
{
echo "<script language='javascript'>\n";
echo " alert('잘못된 접근입니다..');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
?>
<html>
<head>
<title></title>
<script language='javascript'>
function chkForm()
{
frm = document.info;
if(frm.member_name.value == '')
{
alert('이름을 입력하세요!');
return;
}
if(frm.member_cellphone.value == "")
{
alert('핸드폰번호를 입력하세요!');
return;
}
frm.actiontype.value = 1;
frm.submit();
}
function delForm()
{
frm = document.info;
if(confirm('정말 삭제 하겠습니까?'))
{
frm.actiontype.value = 0;
frm.member_cellphone.value = '<?= $member_cellphone ?>';
frm.submit();
}
}
</script>
</head>
<body>
<form name='info' method='POST' action='./mod_member.html'>
<table>
<tr>
<td>&nbsp;이름</td>
<td><input name='member_name' maxlength='20' value='<?= $member_name ?>'></td>
</tr>
<tr>
<td>&nbsp;핸드폰</td>
<td><input name='member_cellphone' maxlength='15' value='<?= $member_cellphone ?>'></td>
</tr>
<tr>
<td colspan='2'>
<input type='hidden' name='group' value='<?= $group_seq ?>'>
<input type='hidden' name='actiontype'>
<input type='hidden' name='org_member_cellphone' value='<?= $member_cellphone ?>'>
<div align='right'><a href='javascript:history.back(-1)'>뒤로</a>&nbsp;<a href='javascript:delForm()'>삭제</a>&nbsp;<a href='javascript:chkForm();'>수정</a></div>
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
}else if(getenv("REQUEST_METHOD") == "POST")
{
$action_type = trim($_POST['actiontype']);
$group_seq = trim($_POST['group']);
$member_name = trim($_POST['member_name']);
$member_cellphone = trim(str_replace("-", "", $_POST['member_cellphone']));
$org_member_cellphone = trim(str_replace("-", "", $_POST['org_member_cellphone']));
$strSql = "SELECT COUNT(group_seq) AS cnt ";
$strSql .= "FROM t_group_member ";
$strSql .= "WHERE group_seq = ".$group_seq." AND member_cellphone = '".$org_member_cellphone."'";
$objConn->query($strSql);
if($objConn->nf() != 0)
{
$objConn->next_record();
$cnt = $objConn->f("cnt");
if($cnt == 1)
{
if($action_type == 0) //삭제
{
$strSql = "DELETE FROM t_group_member ";
$strSql .= "WHERE group_seq = ".$group_seq." AND member_cellphone = '".$org_member_cellphone."'";
}else if($action_type == 1) //수정
{
$strSql = "UPDATE t_group_member ";
$strSql .= "SET member_name ='".$member_name."', ";
$strSql .= " member_cellphone ='".$member_cellphone."', ";
$strSql .= " update_datetime = now() ";
$strSql .= "WHERE group_seq = ".$group_seq." AND member_cellphone = '".$org_member_cellphone."'";
}
$objConn->query($strSql);
echo "<script language='javascript'>\n";
if($action_type == 0)
{
echo " alert('삭제되었습니다.');\n";
}else if($action_type == 1)
{
echo " alert('수정되었습니다.');\n";
}
echo " location.href = './group_list.html';\n";
echo "</script>";
}
}
}
}else
{
echo "<script language='javascript'>\n";
echo " alert('잘못된 접근입니다..');\n";
echo " history.back(-1);\n";
echo "</script>";
die;
}
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1,10 @@
<?php
$id = $_GET['id'];
$pw = $_GET['pw'];
$msg = $_GET['msg'];
echo $id."<br>".$pw."<br>".$msg;
?>
@@ -0,0 +1,611 @@
<?
$serviceType = isset($_GET['service_type']) ? $_GET['service_type'] : $_POST['service_type'];
if($serviceType == "") $serviceType = 0;
//serviceType : the order described in conf file. --_-;
?>
<html>
<head>
<title>######## SYSTEM-HOSTING SERVICE STATUS ######## </title>
<STYLE type=text/css>
TD { FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; }
TR { FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; }
TABLE { FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; line-height : 120%}
INPUT { FONT-SIZE: 12pt; 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:580;
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>
</head>
<body onLoad="UpdateClocks()">
<form name="frm" action=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType ?>">
<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>######## ICS STATUS ########</h3></td>
</tr>
</table>
<table border="0" cellspacing="1" width="430" align="center">
<tr align="left">
<td>
<img src="images/bu14.gif" width=20 height=20>norm&nbsp;&nbsp;
<img src="images/bu77.gif" width=20 height=20>nomon&nbsp;&nbsp;
<img src="images/bu15.gif" width=20 height=20>fail&nbsp;&nbsp;
</td>
</tr>
</table>
<div id="tooltip" name="tooltip" width=530></div>
<?
/* <marquee id="tooltip" name="tooltip"></marquee>*/
$server_addr[0][0] = "127.0.0.1";
$server_addr[0][1] = "30002";
$server_addr[0][2] = "KT-IDC";
$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, 4096);
$test .= trim($test2);
echo "TEST :\n$test2<br>"; // tael@solbox.com
$j = strlen($test2); if($j < 1024) break;
}
fclose($fp);
}
//echo "\n<!-- TEST:\n$test\n-->\n";
?>
<td valign=top>
<?
$pt = new parsePipe();
$test = $pt->nullTrim($test);
$tmpArr = $pt->textArr($test);
$serviceName = $pt->serviceName($test);
$result = $pt->parseIt($tmpArr[$serviceType]);
$tot_tr = $pt->countIt();
?>
<table border=1 cellpadding=1 cellspacing=0>
<tr height="60">
<td colspan="3">
<center><b>
<font color="#000066" size="5">
<!--
<?= $serviceName[$serviceType][0] ?>
-->
<?
if($serviceName[$serviceType][0]=='AION')
echo "AION NCSOFT";
?><br><br>
</font>
</b>
</center>
</td>
</tr>
<tr align="center">
<td width="200"><center><b><font color="#000066">Name</font></b></center></td>
<td width="140"><center><b><font color="#000066">Server IP</font></b></center></td>
<td width="75"><center><b><font color="#000066">Port</font></b></center></td>
<!--
<td width="135"><center><b><font color="#000066">Status<br>Changed</font></b></center></td>
<td width="65"><center><b><font color="#000066">Total Disk</font></b></center></td>
<td width="65"><center><b><font color="#000066">Free</font></b></center></td>
<td width="25"><center><b><font color="#000066">Upload</font>
<img src="http://sh.0x31.com/status/images/bu14.gif" width=20 height=20>norm<br>
<img src="http://sh.0x31.com/status/images/bu16_1.gif" width=20 height=20>disb<br>
<img src="http://sh.0x31.com/status/images/bu15.gif" width=20 height=20>fsck<br>
</b>
</center>
</td>
<td width="50"><center><b><font color="#000066">Disk Busy(Lq)</font></b></center></td>
<td width="100"><center><b><font color="#000066">Traffic INB(Packets)</font></b></center></td>
<td width="100"><center><b><font color="#000066">Traffic OUTB(Packets)</font></b></center></td>
<td width="50"><center><b><font color="#000066">Conn EASTAB(TOT)</font></b></center></td>
-->
</tr>
<?
$totalDisk = 0;
$freeDisk = 0;
$usedDisk = 0;
$totalRTSCount = 0;
$totalTrafficINB = 0;
$totalPacketsINB = 0;
$totalTrafficOUTB = 0;
$totalPacketsOUTB = 0;
$totalConnEstab = 0;
$totalConnAll = 0;
for($j=0; $j<$tot_tr; $j++){
$add_alt = "";
if (!strcmp($result[$j][20], "99FFFF")) {
$add_alt = " (UPLOAD TARGET)";
} else if ($result[$j][10] == 1) {
$add_alt = " (UPLOAD MANUALLY DISABLED)";
} else if ($result[$j][10] == 2) {
$add_alt = " (FSCK RUNNING)";
} else {
$add_alt = "";
}
$alt_str =
"[NAME] : ".
$result[$j][2].
" [STATUS] : ".
$pt->translateIt($result[$j][0], 2).$add_alt.
" [TYPE] : ".
$pt->translateIt($result[$j][1], 0);
$totalDisk += $result[$j][8];
$freeDisk += $result[$j][9];
$usedDisk += ($result[$j][8] - $result[$j][9]);
if($result[$j][2]=="RC004_RCTS01" || $result[$j][2] == "RC004_RCTS02" || $result[$j][2] == "EVENT_DB01")
{
continue;
}
if($result[$j][2] == "EVENT_DB02" || $result[$j][2] == "EVENT_PGLB01")
{
continue;
}
if ($result[$j][1] == 1) {
$totalRTSCount += 1;
}
/* Packets INB */
if ($result[$j][16] != '-') {
$totalPacketsINB += $result[$j][16];
}
/* Traffic INB */
if ($result[$j][17] != '-') {
$totalTrafficINB += $result[$j][17];
}
/* Packets OUTB */
if ($result[$j][18] != '-') {
$totalPacketsOUTB += $result[$j][18];
}
/* Traffic OUTB */
if ($result[$j][19] != '-') {
$totalTrafficOUTB += $result[$j][19];
}
/* Connection Estblished */
if ($result[$j][14] != '-') {
$totalConnEstab += $result[$j][14];
}
/* Connection All */
if ($result[$j][15] != '-') {
$totalConnAll += $result[$j][15];
}
?>
<span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();">
<tr>
<?
if (strrpos($pt->tailer($result[$j][2]), "^") == false)
$servName = $pt->tailer($result[$j][2]);
else
$servName = substr($pt->tailer($result[$j][2]), 0, strrpos($pt->tailer($result[$j][2]), "^"));
?>
<?
switch($result[$j][0])
{
case 2 :
$bgcolor = 'red';
/*
$font_servName = "<font color='red'><b>".$servName."</b></font>";
$font_servIp = "<font color='red'><b>".$result[$j][3]."</b></font>";
$font_servPort = "<font color='red'><b>".$pt->translateIt($result[$j][4],4)."</b></font>";
*/
break;
case 1 :
$bgcolor = 'white';
/*
$font_servName = $servName;
$font_servIp = $result[$j][3];
$font_servPort = $pt->translateIt($result[$j][4],4);
*/
break;
default :
$bgcolor = 'white';
/*
$font_servName = $servName;
$font_servIp = $result[$j][3];
$font_servPort = $pt->translateIt($result[$j][4],4);
*/
break;
}
?>
<td bgcolor=<?=$bgcolor?>><?=$pt->translateIt($result[$j][0],1)?>&nbsp;&nbsp;<?=$servName?></td>
<td bgcolor=<?=$bgcolor?> align="center"><?=$result[$j][3]?></td>
<td bgcolor=<?=$bgcolor?> align="center"><?=$pt->translateIt($result[$j][4],4)?></td>
</tr>
</span>
<?
}
?>
</table></td>
<?
if($i%3 == 2) echo "</table></tr>"; //
}
?>
<table>
</table>
<?
$command = "wget --http-user=ktsh --http-password=5rhkswp0 -O ./mrtg_img/total_aion-day.png http://mrtg.ktsh.co.kr:88/customer/NCSOFT/total_aion-day.png";
system($command);
?>
<!---MRTG START---------->
<br>
<TABLE align="center" BORDER=0 CELLPADDING=0 CELLSPACING=10>
<H5> ◐ AION Cache 서버 트래픽 정보 ◑</H5>
<tr>
<td><img src='mrtg_img/total_aion-day.png'></td>
</tr>
</table>
<!---MRTG END ---------->
<?
////////////////////
//Print REFRESHER
////////////////////
extract($_POST);
$refresh_rate = $_REQUEST['refresh_rate'];
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=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType?>">
<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?>&service_type=<?= $serviceType ?>">
<?
########
#CLASSES
########
class parsePipe {
var $tot_line;
function parseIt($givenText){
$cnt = 0;
$minValue = 0;
$maxValue = 0;
$minLevel = 1000;
$tmp_arr = array();
$temp_arr = explode("\r\n", $givenText);
$result_arr[$i][9] = "";
$this->tot_line = count($temp_arr) == 1 ? 0 : count($temp_arr) - 1;
for($i=0; $i < $this->tot_line; $i++){
if($temp_arr[$i]!='') {
$result_arr[$i] = explode("|", $temp_arr[$i]);
$result_arr[$i][20] = "";
$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];
}
}
*/
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
if ($minLevel > $result_arr[$i][11]) {
$minLevel = $result_arr[$i][11];
}
}
}
}
for ($i = 0; $i < $tot_tr; $i++) {
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0 && $result_arr[$i][11] <= $minLevel) {
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];
}
}
}
}
//echo "minLevel $minLevel minValue $minValue<br>";
$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) {
if ($minLevel < $result_arr[$key][11] ||
$result_arr[$key][10] > 0) {
$result_arr[$key][20] = "yellow";//$maxValue;
} else {
//echo "11 ".$result_arr[$key][11]." 10 ".$result_arr[$key][10]."<br>";
$maxValue = $val;
$result_arr[$key][20] = "99FFFF";
$cnt++;
}
} else {
//if($minValue == $val) {
if($val < (2 * 1024 * 1024 * 1024 * 10)) {
$result_arr[$key][20] = "red";
} else if(($maxValue - $val) < (1024 * 1024 * 1024) &&
$minLevel == $result_arr[$key][11]) {
//echo "1GB Highed<br>";
//echo "minLevel $minLevel maxValue $maxValue<br>";
$result_arr[$key][20] = "99FFFF";
} else {
//echo "1GB Lowed<br>";
$result_arr[$key][20] = "yellow";//$maxValue;
}
}
} else {
$result_arr[$key][20] = "white";
}
}
return $result_arr;
}
function countIt(){
return $this->tot_line;
}
function translateIt($parsedText, $type){
if($parsedText == '') return;
$eServerType = array('WWW', 'RTS', 'RC', 'CCDB', 'RCTS', 'GTS', "RCDB");
$eStatus = array('<img src=images/bu16_1.gif width=20 height=20>',
'<img src=images/bu14.gif width=20 height=20>',
'<img src=images/bu15.gif width=20 height=20>',
'<img src=images/bu77.gif width=20 height=20>');
$eStatusUP = array('<img src=images/bu14.gif width=20 height=20>',
'<img src=images/bu16_1.gif width=20 height=20>',
'<img src=images/bu15.gif width=20 height=11>');
$eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD', 'NO MONITORING');
switch($type){
case 0:
return $eServerType[$parsedText];
return '';
case 1:
return $eStatus[$parsedText];
case 2:
return $eStatusChar[$parsedText];
case 3:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("<b>%.2fGB</b>",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
if (trim($parsedText) / 1024 / 1024 > 10) {
return sprintf("<font color=\"blue\"><b>%.2fMB</b></font>",
trim($parsedText) / 1024 / 1024 );
} else {
return sprintf("<b>%.2fMB</b>",
trim($parsedText) / 1024 / 1024 );
}
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fKB",
trim($parsedText) / 1024 );
} else {
return sprintf("%dB",
trim($parsedText));
}
}
}
}
case 8:
if(trim($parsedText) == "-" || $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);
}
case 10:
return $eStatusUP[$parsedText];
case 30:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("%.2fG",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
return sprintf("%.2fM",
trim($parsedText) / 1024 / 1024 );
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fK",
trim($parsedText) / 1024 );
} else {
return sprintf("%d",
trim($parsedText));
}
}
}
}
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 || $tmp_str != " ") {
$return_str .= substr($tmp_str, $i, 1);
}
}
return $return_str;
}
function textArr($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
//$str_arr[$cnt][30] = $search_str[0];
//echo $str_arr[$cnt][0]."<br>".$tmp_search_str."->".$cnt."<-"."<br>";
$cnt++;
}
$str_arr[$cnt] .= $temp_arr[$i]."\r\n";
}
return $str_arr;
}
function serviceName($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
//echo $split_str[0]."<br>";
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
$cnt++;
}
$str_arr[$cnt][0] = $tmp_search_str;
if($split_str[0] == 2) {
$str_arr[$cnt][1] = "dead";
}
// $str_arr[4][1] = "dead";
// $str_arr[1][1] = "dead";
}
return $str_arr;
}
function tailer($name)
{
$temp_arr = explode("_", $name);
$temp_arr2 = substr($name, strlen($temp_arr[0]) + 1, strlen($name));
return $temp_arr2;
}
function noYear($date)
{
$date = substr($date, 5, 14);
return $date;
}
}
?>
@@ -0,0 +1,12 @@
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;