Back to OP5 Monitor FAQ

How to monitor a KVM installation

The purpose of this article is to describe how OP5 Monitor can be used with the check_libvirt plugin for agentless monitoring of resource usage on a KVM installation. At the moment the plugin can monitor:

Host-specific parameters:

VM-specific parameters:

Prerequisites Copied

Check commands Copied

SSH as transport protocol Copied

If you use SSH, import the required check-commands in your configuration (‘Configure’ -> ‘Check Command Import -> check_libvirt_kvm*’). After the import you will have the following check commands:

Commands for guest VM’s Copied

command_name command_line
check_libvirt_kvm_guest_cpu $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -N $ARG2$ -l CPU
check_libvirt_kvm_guest_disk_io $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -N $ARG2$ -l IO
check_libvirt_kvm_guest_mem $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -N $ARG2$ -l MEM
check_libvirt_kvm_guest_net_io $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -N $ARG2$ -l NET

Commands for KVM host server Copied

command_name command_line
check_libvirt_kvm_host_running $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -l LIST
check_libvirt_kvm_host_storage_pool $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -l POOL -s $ARG2$
check_libvirt_kvm_host_volume $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -l VOLUME -s $ARG2$/$ARG3$
check_libvirt_kvm_host_volume_all $USER1$/check_libvirt -H qemu+ssh://$ARG1$@$HOSTADDRESS$/system -l VOLUME

Note: $ARG1$ macro in the command_line refer to the user you will use to connect to the KVM host server, in these case root, the $HOSTADDRESS$ refer to the KVM host and the $ARG2$ refer to the guest VM-name.

TLS as transport protocol Copied

If you prefer to use TLS, then you can add the above check command to your configuration; you only need to replace qemu+ssh with qemu+tls, (‘Configure’ -> ‘Commands’ -> ‘Add new command’ -> ‘Go’).

Adding the services Copied

Some service examples follow.

Add the required services as your needs, (‘Configure’ -> ‘Host: ’ -> ‘Go’ -> ‘Services for host ’ -> ‘Add new service’ -> ‘Go’):

Arguments are just examples; you need to adjust them to suit your environment.

Services for guest VM Copied

service_description check_command check_command_args Note
VM CPU Usage check_libvirt_kvm_guest_cpu root!sandbox-peer *
VM Mem Usage check_libvirt_kvm_guest_mem root!sandbox-peer *
VM Disk IO Usage check_libvirt_kvm_guest_disk_io root!sandbox-peer *
VM Net IO Usage check_libvirt_kvm_guest_net_io root!sandbox-peer *

Services for KVM host server Copied

service_description check_command check_command_args Note
KVM storage pool usage check_libvirt_kvm_host_storage_pool root!default *
KVM guest volume usage check_libvirt_kvm_host_volume root!win-sth1!default *
KVM all volume usage check_libvirt_kvm_host_volume_all root *
KVM running vm list check_libvirt_kvm_host_running root *

* Note: No warning or critical arguments are used in these examples. The plugin does however support thresholds.

This plugin and these check_commands have been successfully tested on CentOS/RHEL v.5.5 and 6.x with KVM 2.x.

More information about libvirt can be found at: www.libvirt.org

["Geneos"] ["FAQ"]

Was this topic helpful?