recv = common.common.getconf(ini_file, 'info', 'mail_reciever') mail_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mail', 'mail-'+svr) server.make_mail_file(mail_file, svr, 'server restart is done', 'Now binary sync & svc start') server.send_mail('[INFO] ' +svr+' restart done', sender, recv, mail_file ) time.sleep(15) else: logging.info('[%s] server restart is now processing, after 1min re check!! - uptime %s' % (svr, is_uptime)) tmp_var = tmp_var +1 time.sleep(60) # os설정 이후 필요한 필수 패키지 및 서비스 공통 설정 스크립트 실행 os_set_flag = 1 while os_set_flag == 1: is_restart_done = server.is_open_port(svr, 22) if is_restart_done == True: server.rcp_lib(svr, os_set_acc, passwd, remote_lib) time.sleep(30) configure_flag = server.run_procedure(svr, os_set_acc, 'sudo', passwd, remote_lib, script[0], '', 100) time.sleep(30) if configure_flag == True: os_set_flag = 0 logging.info('[%s] server OS Setting is done, after 30s next step' % svr) else: logging.info('[%s] server OS Setting is now processing, after 1min re check!! %s' % (svr, err)) time.sleep(60)
localsvc.index(hostname) except: continue logging.info('[HOSTNAME] : %s ' % hostname) svc = svc_arg svc_port = getconf(configfile, 'service', svc_arg+'_port') logging.info('[SVC] This server is %s : %s' % (svc, svc_port)) basedir = getconf(configfile, 'basedir', svc) error_file = os.path.join(error_dir, hostname+'-service.err') #1.svc status 체크 port, pid, tracelog(이 부분은 추가 개발...) svc_pids = server.is_pid_same(svc, basedir) svc_status = server.is_open_port(hostname, int(svc_port)) if svc_pids == True & svc_status == True: logging.info('[SVC] %s status is well' % svc) else: msg = '''[SVC][%s %s] port: %s, svc_status: %s, pid_status: %s''' % ( svc, hostname, svc_port, svc_status, svc_pids) server.make_err_file(error_file, svc, 'fail', msg) # check the server alive svr_list = getconf(configfile, 'servers', 'cluster') for svr in svr_list.split(","): if svr == "cluster-windows": svr_port = 3389