在java中,有没有办法检查Windows服务的状态? [英] Is there any way, in java, to check on the status of a windows service?
本文介绍了在java中,有没有办法检查Windows服务的状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一个库,可以让我查看Windows服务的状态,以验证服务是否已启动并正在运行。我查看了Sigar库,但它是GPL,因此我无法使用它。需要商业或BSD(ish)许可证,因为它将捆绑到商业软件中。
I am looking for a library that will allow me to look up the status of a windows service to verify that the service is started and running. I looked into the Sigar library, but it is GPL and therefor I cannot use it. A Commercial or BSD(ish) license is required as this will be bundled into commercial software.
推荐答案
如果没有其他帮助,请尝试想到一个稍微不同的方法(当然,如果你可以的话),例如:
If nothing else helps, try to think of a slightly different approach (if you can, of course), e.g.:
- 有很多免费/非免费的进行监控的软件,包括Windows服务监控(例如nagios,Zabbix等)。这些监视器通常具有开放式API,您的Java应用程序可以通过多种不同方式集成。
- 如果您可以控制依赖服务应用程序,那么为Java应用程序提供另一种不同的方式检查(例如,在端口上运行虚拟侦听器,创建文件等)。 Windows服务不是跨平台的东西,因此不会很快得到支持。
这篇关于在java中,有没有办法检查Windows服务的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文