Java程序监视系统健康状况的最佳方法是什么? [英] What is the best way for a Java program to monitor system health?

查看:565
本文介绍了Java程序监视系统健康状况的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够从基于Java的系统内部监控我的主要系统健康指标。主要景点包括CPU温度,主板温度,风扇速度等。

I would like to be able to monitor my major system health indicators from inside our Java-based system. Major points of interest include CPU temperature, motherboard temperature, fan speed, etc.

是否有可用的套餐:


  1. 使这类数据可供Java使用吗?

  2. 适用于Windows或Linux或两者兼有?

  3. 是打开/免费/便宜?


推荐答案

Windows和Linux都支持MIB您正在通过SNMP查找的参数。此外,大多数主要供应商都为其服务器硬件发布了特殊的MIB。

There are MIBs supported by both Windows and Linux that expose the parameters you are looking for via SNMP. Also, most major vendors have special MIBs published for their server hardware.

我已经使用商业广告实现了SNMP MIB并监控Java应用程序 iReasoning SNMP API ,他们工作得很好。还有开源的 SNMP4J ,我个人没有经验,但看起来还不错。

I have implemented SNMP MIBs and monitoring for Java applications using the commercial iReasoning SNMP API and they worked great. There is also the open source SNMP4J, which I don't personally have experience with, but looks pretty good.

因此,根据您的需要,您可以打开要监控的主机的SNMP信息发布。无需编码。这只是一个配置问题。

So, for your needs, you would turn on the publishing of SNMP information for the hosts you want to monitor. No coding necessary. This is just a configuration issue.

例如,对于CPU温度,必须启用MIB LM-SENSORS-MIB。在Linux下,您可以使用snmpwalk客户端查看OID .1.3.6.1.4.1.2021.13.16.2.1.3
以查看CPU温度。一旦掌握了这一点并且您知道它正确发布数据,您就可以开始实施真正的监控解决方案了。

For CPU temperature, for example, you must enable the MIB LM-SENSORS-MIB. Under Linux you can use the snmpwalk client to take a look at OID .1.3.6.1.4.1.2021.13.16.2.1.3 to see CPU temperature. Once you have that up and you know it's publishing data correctly, you can begin to implement your real monitoring solution.

您可以使用Java SNMP库进行轮询和订阅要监视的主机的SNMP陷阱。您还可以使用任何商业或开源监控工具(Google用于 SNMP控制台)。

You can use a Java SNMP library to poll and subscribe to SNMP traps for the hosts you want to monitor. You could also use any commercial or open-source monitoring tool (Google for SNMP console).

这篇关于Java程序监视系统健康状况的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆