KVM guest VM process state parameters (shell script)

This template is to illustrate a monitoring of various parameters of the virtual machines that use KVM as hypervisor.

On the host being monitored, the user name used to authenticate should have the following permission in /etc/sudoers file:
Defaults:monitor.user !requiretty
monitor.user ALL=NOPASSWD: /bin/cat /proc/*
Monitors description:
  • Nice priority: guest VM process priority adjustment, as if set by nice utility (19 means the least priority, -20 means the highest; 0 is default priority)
  • Threads used: how many threads uses VM guest process
  • Total data read (MB): total amount of data read from storage devices (since the moment the process exists)
  • Total data written (MB): total amount of data written to storage devices (since the moment the process exists)
  • Total inbound network traffic (MB): total amount of inbound data received from network (since the moment the process exists)
  • Total outbound network traffic (MB): total amount of outbound data sent over network (since the moment the process exists)
  • Virtual memory peak usage (MB): highest known virtual memory usage (since the moment the process exists)
  • Virtual memory swapped (VM): amount of virtual memory currently swapped out
  • Virtual memory used (MB): amount of virtual memory currently allocated
Important: in every template, please replace "vmname" parameter from monitor definition, set it to actual KVM "domain name" (virtual machine name, as reported by "virsh list" command).

Note: the template and underlying shell script are given as starting point to create more shell script-based monitors.

If an error occurs, text explanation is output by the script and non-zero return code sent, to indicate monitor failure.
KVM-guest-VM-process-state-parameters.zip 2.6K Downloaded: 17116 times
Sign In or Register to comment.