寻找虚拟机的CPU、磁盘和内存使用情况,使用Java程序。

huangapple go评论81阅读模式
英文:

Find CPU, disk and memory usuage of a virtual machine using Java Program

问题

如何使用Java程序查找虚拟机的CPU、磁盘和内存使用情况?是否有可用的API或第三方库可以使用?因为我希望在CPU使用率超过75%、内存不足和磁盘空间不足时警报我的客户。

  1. 操作系统: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.

  1. 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.

huangapple
  • 本文由 发表于 2020年4月8日 11:43:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/61092978.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定