英文:
Find CPU, disk and memory usuage of a virtual machine using Java Program
问题
如何使用Java程序查找虚拟机的CPU、磁盘和内存使用情况?是否有可用的API或第三方库可以使用?因为我希望在CPU使用率超过75%、内存不足和磁盘空间不足时警报我的客户。
- 操作系统:Redhat 7
非常感谢您的帮助。
英文:
How to find CPU, disk and memory usage of a virtual machine using Java Program? Any API or third party library that i can use? As i want to alert my client when CPU usage is more than 75, low memory and disk space.
- OS : Redhat 7
Thank you so much for your help.
答案1
得分: 1
引用自 oshi
Github 项目页面
OSHI 是一个基于 JNA(本地)的免费操作系统和硬件信息库,用于 Java。它不需要安装任何额外的本地库,并旨在提供一个跨平台的实现,用于检索系统信息,如操作系统版本、进程、内存和CPU使用情况、磁盘和分区、设备、传感器等。
英文:
Quoted from oshi
Github Project Page
> OSHI is a free JNA-based (native) Operating System and Hardware Information library for Java. It does not require the installation of any additional native libraries and aims to provide a cross-platform implementation to retrieve system information, such as OS version, processes, memory & CPU usage, disks & partitions, devices, sensors, etc.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论