Cross-platform API for system information

北战南征 提交于 2020-01-02 05:41:17

问题


I'm looking for a library that will provide this type of information:

RAM
Swap space
Number of CPUs
speed (CPU MHz)
Number of cores
Chip type

Ultimately I'll be calling into it from Java, but a C library would be fine, which I can wrap with JNI.

Platforms of interest include, but not limited to, AIX, HP-UX, Solaris, Windows.

Thanks!


回答1:


Like you I was looking for a cross platform system info library and found this:

http://code.google.com/p/geekinfo/

I didn't test it yet but it might suit your needs.

good luck !




回答2:


You can take a look at Sigar which supports the metrics and platforms that you want and has both C and Java APIs. It is GPL, which may or may not suit your needs.




回答3:


Are you looking to query these systems remotely? If so, your best bet will probably be to use an SNMP library.




回答4:


You may want to check out the following documentation site: http://en.wikipedia.org/wiki/Hardware_abstraction_layer

Also check out the Open Audit computer auditing and inventory tracking system http://www.open-audit.org source code and their script for auditing linux machines for examples of querying a hal database.

You may also want to check out the Nagios Plugins project for a large stash of open source scripts for collecting stats remotely from other machines. Nagios is designed as an Enterprise administration / up-time monitoring system for data centers, but the scripts could easily be used standalone for monitoring in different configurations.



来源:https://stackoverflow.com/questions/654643/cross-platform-api-for-system-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!