web-project 故障查看功能 检测是否启动fmd服务

def check_fmd_service():
    try:
        output = subprocess.check_output(svcs -H -o state fmd,shell=True)
        state = output.decode(UTF-8).strip()
        if state == online:
            return True
        elif state == disabled:
            subprocess.call(svcadm enable fmd,shell=True)
            log_debug(enable fmd svc.)
        elif state == maintenance:
            subprocess.call(svcadm clear fmd,shell=True)
            log_debug(clear fmd svc.)
            
        ‘‘‘wait‘‘‘
        for i in range(5):
            output = subprocess.check_output(svcs -H -o state fmd,shell=True)
            state = output.decode(UTF-8).strip()
            if state == online:
                return True
            time.sleep(1)
    except:
        pass
    
    log_debug(check and online fmd svc failed.)
    return False

 

web-project 故障查看功能 检测是否启动fmd服务,布布扣,bubuko.com

web-project 故障查看功能 检测是否启动fmd服务

上一篇:在ASP.NET中支持断点续传下载大文件(ZT)


下一篇:眼下最好的JSP分页技术