检查远程服务器的服务状态
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了检查远程服务器的服务状态相关的知识,希望对你有一定的参考价值。
fn checkService ServiceName server = ( dotnet.loadassembly "System.ServiceProcess" sc = dotNetObject "System.ServiceProcess.ServiceController" if (server == "") do server = "." -- if no server is supplied, run the check on the local machine sc.Machinename = server try(scServices = sc.GetServices(server))catch(return "Timed Out") for scTemp in scServices do ( if (scTemp.ServiceName as string == ServiceName) then ( --print ( ServiceName + " - " + server + " - " +scTemp.Status.toString() ) return scTemp.Status.ToString() ) ) return "Service Not found" )
以上是关于检查远程服务器的服务状态的主要内容,如果未能解决你的问题,请参考以下文章
如何使用来自远程服务器的 net.tcp 端点 ping 或检查 WCF 服务的状态?