简体   繁体   English

如何通过 JMX 获取网络 I/O 和磁盘 I/O

[英]How to get Network I/O and Disk I/O through JMX

I have been working on to get system mertics like CPU, Memory, Network I/O, Disk I/O using JMX.我一直在努力使用 JMX 获得系统指标,如 CPU、Memory、网络 I/O、磁盘 I/O。

  • For CPU i have used function OperatingSystemMXBean.getSystemLoadAverage() and got the load of CPU.对于 CPU,我使用了 function OperatingSystemMXBean.getSystemLoadAverage() 并获得了 CPU 的负载。

  • For Memory i have used functions OperatingSystemMXBean.getTotalPhysicalMemorySize() and OperatingSystemMXBean.getFreePhysicalMemorySize().对于 Memory,我使用了函数 OperatingSystemMXBean.getTotalPhysicalMemorySize() 和 OperatingSystemMXBean.getFreePhysicalMemorySize()。

Is there any function to get Network I/O and Disk I/O through JMX?有没有 function 通过 JMX 获取网络 I/O 和磁盘 I/O?

Most VMs (all?) do not expose that data.大多数虚拟机(全部?)都不会公开这些数据。 You would need to use a library like sigar (source is at github ), that can gather those values and then expose the return values of sigar via JMX.您需要使用像sigar这样的库(源代码位于github ),它可以收集这些值,然后通过 JMX 公开 sigar 的返回值。

We are using sigar with success in http://rhq-project.org/我们在http://rhq-project.org/ 中成功使用了 sigar

I found out that SIGAR API will get the System Metrics easily.我发现 SIGAR API 将轻松获得系统指标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM