### ######## 오엘 소프트 꺼 EASTAB(TOT)만 구하기 ########

"; $fp = @fsockopen("udp://{$server_addr[$i][0]}", $server_addr[$i][1], $errno, $errstr); if (!$fp) { echo "ERROR: $errno - $errstr
\n"; continue; } else { fwrite($fp,"GET_SERVSTATUS", 15); while( !feof ($fp) ) { $test2 = fgets($fp, 2048); echo $test2; if (!strstr ( $test2, 'OLSOFT' )) { continue; } $test3 .= trim($test2); break; } echo "

     $test3

"; fclose($fp); } } echo "TEST :

    $test

"; exit; ?> nullTrim($test); $tmpArr = $pt->textArr($test); $serviceName = $pt->serviceName($test); $result = $pt->parseIt($tmpArr[$serviceType]); $tot_tr = $pt->countIt(); echo "

\n"; echo "
\n"; for($k=0; $k<sizeof($serviceName); $k++) { if ( $serviceName[$k][0] != 'OLSOFT' ) continue; echo " <td width='100' height='35'>\n"; echo " "; if($serviceName[$k][1] != "dead") { echo ""; } else { echo ""; } echo ""; echo $serviceName[$k][0]; echo ""; echo "
(NS-RC02)"; break; echo "

\n"; } echo "
\n"; echo " \n"; ?>

MNG SERVER IP: , PORT: ()
Name | Server IP | Port | Status Changed | Conn EASTAB(TOT)
translateIt($result[$j][1], 0); if ($result[$j][1] == 1) { $totalRTSCount += 1; } /* Connection Estblished */ if ($result[$j][14] != '-') { $totalConnEstab += $result[$j][14]; } /* Connection All */ if ($result[$j][15] != '-') { $totalConnAll += $result[$j][15]; } ?>
translateIt($result[$j][0],1)?> translateIt($result[$j][1],999) */ ?> tailer($result[$j][2])?> |  | translateIt($result[$j][4],4)?> | noYear(date("Y-m-d H:i:s", $result[$j][5]))?> | () "; ?>
| Storage Total | RTS Total : | translateIt($totalDisk, 9)?> | translateIt($freeDisk, 9)?> | Network Total | 0) { ?> translateIt($totalTrafficINB,30)?>B(translateIt($totalPacketsINB,30)?>p) - | 0) { ?> translateIt($totalTrafficOUTB,30)?>B(translateIt($totalPacketsOUTB,30)?>p) - | 0) { ?> () -

"; // ?>

1000) $refresh_rate = 60; ?>

Refresh Rate : > (MIN : 1, MAX : 1000)
method=POST>

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
"; $cnt = 0; arsort($tmp_arr); reset($tmp_arr); while (list ($key, $val) = each ($tmp_arr)) { //echo "$key = $val
"; 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]."
"; $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
"; //echo "minLevel $minLevel maxValue $maxValue
"; $result_arr[$key][20] = "99FFFF"; } else { //echo "1GB Lowed
"; $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('UNKNOWN', 'ALIVE', 'DEAD');*/ $eStatus = array('', '', ''); $eStatusUP = array('', '', ''); $eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD'); 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("%.2fGB", trim($parsedText) / 1024 / 1024 / 1024 ); } else { if (trim($parsedText) / 1024 > 1024) { if (trim($parsedText) / 1024 / 1024 > 10) { return sprintf("%.2fMB", trim($parsedText) / 1024 / 1024 ); } else { return sprintf("%.2fMB", 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."<-"."
"; $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; } } ?>