"; echo ""; echo ""; echo "Maintenance > Control Panel > MSS Sync "; echo ""; echo ""; $helpId="2.58"; showHelp($helpId); echo ""; echo ""; echo ""; adjust_title_tail(); adjust_content_head(); echo "
"; //show the page echo "

"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
MSS Configuration Synchronization
"; if($operation==1) { echo ""; echo ""; } else { echo ""; echo ""; } echo "
Warning: This operation will overwrite the MSS configuration data on the target server.
"; $ftpInfo=getMSSFtpAccount(); if($operation==1) { //start if($direction==0) { echo "

Start to synchronize from MSS-0 to MSS-1
"; insertLog("Synchronize conf files from MSS-0 to MSS-1"); } else { echo "

Start to synchronize from MSS-1 to MSS-0
"; insertLog("Synchronize conf files from MSS-1 to MSS-0"); } echo "The operation will last many minutes, please wait...
"; flush(); //check the heartbeat of mss-0 echo "Check the connection to MSS-0..."; flush(); $database="OMC_PUB"; $selSql = "SELECT ip FROM sysInfo where sysTypeNo=320 and sysNo=0 and baseStat=1 "; $selRes = @mysqli_query($pubConn,$selSql); $count=0; $count=mysqli_num_rows($selRes); echo mysqli_error($pubConn); $mss_0_ip=""; if($count==1) { echo "successful
"; $selRow = @mysqli_fetch_array($selRes); $mss_0_ip=$selRow[ip]; //echo "mss_0_ip=$mss_0_ip
"; } else { echo "failed
"; echo "The MSS-0 is unavailable
"; back(); } flush(); //check the heartbeat of mss-1 echo "Check the connection to MSS-1..."; flush(); $database="OMC_PUB"; $selSql = "SELECT ip FROM sysInfo where sysTypeNo=320 and sysNo=1 and baseStat=1 "; $selRes = @mysqli_query($pubConn,$selSql); $count=0; $count=mysqli_num_rows($selRes); echo mysqli_error($pubConn); $mss_1_ip=""; if($count==1) { echo "successful
"; $selRow = @mysqli_fetch_array($selRes); $mss_1_ip=$selRow[ip]; //echo "mss_1_ip=$mss_1_ip
"; } else { echo "failed
"; echo "The MSS-1 is unavailable
"; back(); } flush(); //get the conf file from mss /* $mss_conf_file=array("msc_art.conf", "msc_conf", "msc_cua.conf", "msc_dps.conf", "msc_la.conf", "msc_mg.conf", "msc_rzs.conf", "msc_system.conf", //"none.conf", "msc_tg.conf"); */ $get_mss_ip=""; $put_mss_ip=""; if($direction==0) { $get_mss_ip=$mss_0_ip; $put_mss_ip=$mss_1_ip; $get_msc_name="MSS-0"; $put_msc_name="MSS-1"; } else { $get_mss_ip=$mss_1_ip; $put_mss_ip=$mss_0_ip; $get_msc_name="MSS-1"; $put_msc_name="MSS-0"; } //get the conf file list by ftp $conn_id=ftp_connect($get_mss_ip); if($conn_id == FALSE) { echo "FTP:connect to $get_mss_ip failed.
"; back(); } if(FALSE == ftp_login($conn_id,$ftpinfo[UserName],$ftpinfo[Password])) { echo "FTP:login to $get_mss_ip failed.
"; back(); } $contents=ftp_rawlist($conn_id, "/usr/local/wxc2/bin/conf/"); foreach ($contents as $entry) { $part=explode(" ",$entry); if(!strstr($part[0],"d")) { $mss_conf_file[]=$part[sizeof($part)-1]; } } ftp_close($conn_id); //get conf file for($i=0;$i".$mss_conf_file[$i]." from $get_msc_name...successful
"; } else { echo "Get conf file ".$mss_conf_file[$i]." from $get_msc_name...failed
"; echo "The operation is failed.
"; back(); } flush(); system("rm -rf result.txt"); } //change the privilege and stop msc echo "
Prepare to update the conf file into ".$put_msc_name."
"; echo "Stop the ".$put_msc_name."..."; flush(); system("./stopMsc ".$put_mss_ip); echo "successful
"; flush(); //put file for($i=0;$i".$mss_conf_file[$i]." to $put_msc_name...successful
"; } else { echo "Put conf file ".$mss_conf_file[$i]." to $put_msc_name...failed
"; } flush(); system("rm -rf {$mss_conf_file[$i]}"); } //change the privilege and stop msc echo "Start the ".$put_msc_name."..."; flush(); system("./startMsc ".$put_mss_ip); echo "successful
"; flush(); echo "The operation is successful.
"; back(); } //function define function back() { global $mss_conf_file; for($i=0;$iBack"; exit; } adjust_content_tail(); ?>