sensu-plugins / sensu-plugins-cpu-checks

This plugin provides native CPU instrumentation for monitoring and metrics collection, including: CPU usage and metrics for user, nice, system, idle, iowait, irq, softirq, steal, and guest.
http://sensu-plugins.io
MIT License
13 stars 34 forks source link

Take iowait, steal, guest and guest_nice into account for idle CPU time. #5

Closed moriyoshi closed 8 years ago

moriyoshi commented 8 years ago

(Originally posted as https://github.com/sensu/sensu-community-plugins/pull/1253 )

Currently check_cpu plugin only picks idle as a metric of CPU idle time, but this doesn't always give desired results. At least iowait needs to be included there considering the purpose of this plugin. Besides, steal, guest and guest_nice should be taken into account because they are involuntary time consumption outside the VM.

This patch adds guest_nice to the line-ups of metrics, which has been available in Linux since 2.6.33.

This patch also adds a new option --idle-metrics whose value specifies the names of the metrics that are included in the calculation of CPU idle time as a comma-separated string. The value defaults to idle,iowait,steal,guest,guest_nice