$server_ip ); $result = $rpcService->__call("shield.server.remove",$param); if ( $result == "OK" ) { $chkDelete = " DELETE from conf_server WHERE server_ip = '$server_ip' "; @mysql_query($chkDelete, $connect) or die(mysql_error()); //@@@ conf_server_group_sub 과 userconf 삭제하거나 체크 필요. } else { echo "{result:0}" ; exit; } } if($connect) mysql_close($connect); exit; } else if ($flag == "INSERT" ) { $rpcService = new jsonRPCClient("$NASOL_XMON_HTTP_URL/JSON-RPC"); $result = callServerRcp("shield.server.insert", $_POST[server_ip], $_POST[alias_name], $_POST[port],$_POST[order],$_POST[view],$_POST[health_check],$_POST[log]); if ( $result != "OK" ) { echo "{result:0}" ; exit; } if ( checkServerRcp($_POST[server_ip]) !== 1 ) { echo "{result:0}" ; exit; } insertServer($_POST[server_ip], $_POST[alias_name], $_POST[port],$_POST[order],$_POST[view],$_POST[health_check],$_POST[log],$_POST[etc1_yn]); if($connect) mysql_close($connect); exit; } else if ($flag == "UPDATE" ) { $rpcService = new jsonRPCClient("$NASOL_XMON_HTTP_URL/JSON-RPC"); $result = callServerRcp("shield.server.update", $_POST[server_ip], $_POST[alias_name], $_POST[port],$_POST[order],$_POST[view],$_POST[health_check],$_POST[log]); if ( $result != "OK" ) { echo "{result:0}" ; exit; } $sql = " update conf_server set name = '$_POST[alias_name]' , port = '$_POST[port]' , order_num = $_POST[order] , view_yn = '$_POST[view]' , etc1_yn = '$_POST[etc1_yn]' , health_check_yn = '$_POST[health_check]' , log_yn = '$_POST[log]' where server_ip = '$_POST[server_ip]' " ; @mysql_query($sql, $connect) or die(mysql_error()); if($connect) mysql_close($connect); exit; } else if ($flag == "list" ) { $str = $_POST["str"] ; $start = $_POST["start"] ; $count = $_POST["count"] ; if (!$start) $start = 0 ; else $start = (int)$start; if ( $count == "" ) { $count = $_GET["count"] ; } if (!$count) $count = 20 ; else $count = (int)$count; if ( $stype == "excel" ) { $start = 0 ; $count = 20000 ; } if ( $str ) { $search_sql = " and ( name like '%$str%' or server_ip like '%$str%' ) " ; } $from_sql = " from conf_server where 1 = 1 $USER_SERVER_SQL $server_group_sql $search_sql " ; $count_sql = " select count(*) as cnt $from_sql " ; $sql = " select * ". $from_sql . " order by order_num asc, INET_ATON(server_ip) asc LIMIT " . $start . ", " . $count . " " ; if ( $stype == "excel_sample" ) { $sql = " select 'test' as name , '192.168.10.1' as server_ip , '10' as order_num , '0' as view_yn , '1' as log_yn , '1' as health_check_yn , '80,8080' as port , '0' as etc1_yn " ; } $count_result=mysql_query($count_sql, $connect) or die (mysql_error()); if ($data=mysql_fetch_array($count_result)) { $total_count = $data[0]; //total_count } else { $total_count=0; } } $result=mysql_query($sql, $connect) or die (mysql_error()); if ( $stype == "excel" || $stype == "excel_sample" ) { $excelTitleArray = array( array( 'col_name' => 'name' , 'title' => $LANG_SERVER_NAME , 'type' => '' ) , array( 'col_name' => 'server_ip' , 'title' => $LANG_SERVER_IP , 'type' => 'string' ) , array( 'col_name' => 'order_num' , 'title' => $LANG_ORDER_NUM , 'type' => '' ) , array( 'col_name' => 'view_yn' , 'title' => $LANG_DASH_VIEW , 'type' => '' ) , array( 'col_name' => 'log_yn' , 'title' => $LANG_DETAIL_LOG , 'type' => '' ) ); if ( $XMON_HEALTH_CHECK == "Y" ) { array_push($excelTitleArray, array( 'col_name' => 'health_check_yn' , 'title' => $LANG_HEALTH_CHECK , 'type' => '' ) ); array_push($excelTitleArray, array( 'col_name' => 'port' , 'title' => $LANG_PORT , 'type' => 'string' ) ); } if ( $TUNA_ENABLE == "Y" ) { array_push($excelTitleArray, array( 'col_name' => 'etc1_yn' , 'title' => "Tuna" , 'type' => '' ) ); } $today = date("Y-m-d") ; $filename = "server_".$today ; if ( $stype == "excel_sample" ) { $filename = "server" ; } exportExcelMysql($excelTitleArray, $filename, $result, true) ; exit; } ?> {"total_count":"","datalist": [ { "alias_name":"" ,"index":"" ,"server_ip":"" ,"port":"" ,"order":"" ,"view":"" ,"log":"" ,"health_check":"" ,"etc1_yn":"" } ]}