-
Notifications
You must be signed in to change notification settings - Fork 24
Home
pve-monitor is a nagios plugin to monitor proxmox VE clusters. It permits a comprehensive monitoring of your services by using PVE API to get cluster status.
Feel free to fork / contribute / report bugs ;-)
This page describes how to use this plugin with Nagios. I think it is easy to adapt for shinken. You can edit this page if you want to improve this documentation by adding configuration steps for other systems/configurations or any other details.
- centralised configuration
- nodes monitoring
- storages monitoring
- openvz vms monitoring
- qemus vms monitoring
- nothing to install on monitored resources !
pve-monitor uses proxmox-ve-api-perl Perl module. For the moment, use my fork as the original contains an infinite loop which prevents it to work. I'll edit this page as soon as the original one is fixed.
For Debian | Ubuntu
apt-get install git libjson-perl libwww-perl libio-socket-ssl-perl libswitch-perl
cpan install Net::Proxmox::VE
wget -O pve-monitor.tar.gz https://github.com/dpiquet/pve-monitor/archive/Stable-1.06.tar.gz
tar zxvf pve-monitor.tar.gz
cd pve-monitor-Stable-1.06/
cp pve-monitor.pl /usr/lib/nagios/plugins/
Add a file pve-monitor.cfg to /etc/nagios-plugins/config/:
define command{
command_name check_pve_cluster_nodes
command_line /usr/bin/perl /usr/lib/nagios/plugins/pve-monitor.pl --conf /etc/nagios3/pve-monitor.conf --nodes
}
# 'check_pve_cluster_openvz command definition
define command{
command_name check_pve_cluster_openvz
command_line /usr/bin/perl /usr/lib/nagios/plugins/pve-monitor.pl --conf /etc/nagios3/pve-monitor.conf --openvz
}
# 'check_pve_cluster_qemu command definition
define command{
command_name check_pve_cluster_qemu
command_line /usr/bin/perl /usr/lib/nagios/plugins/pve-monitor.pl --conf /etc/nagios3/pve-monitor.conf --qemu
}
# 'check_pve_cluster_storage command definition
define command{
command_name check_pve_cluster_storage
command_line /usr/bin/perl /usr/lib/nagios/plugins/pve-monitor.pl --conf /etc/nagios3/pve-monitor.conf --storages
}
The 'nodes' are used to request the pve api. the first to answer is asked for the cluster status, so be sure to only add nodes from the same cluster !
See the example configuration file for syntax.
Note: You should create a read only user on your nodes. To do so, log in one of your cluster's nodes and check Datacenter -> Users -> Add
If you used proxmox ve authentication server as realm, don't forget to set realm pve to pve-monitor configuration file.
Then, go to permissions tab and give the user you just created the role PVEAuditor on path / with propagate.
Warning: the configuration file parser is quite silly, please keep it clean to avoid errors.
add a file pve-cluster.cfg in /etc/nagios3/conf.d/
# Define the cluster itself as a host
# the command check_pve_cluster_nodes give us info
# on the member's cluster state
define host {
host_name pve-cluster
max_check_attempts 10
check_command check_pve_cluster_nodes
}
# define openvz, qemu and storages as services of the cluster
define service{
use generic-service
host_name pve-cluster
service_description OpenVZ VMs
check_command check_pve_cluster_openvz
}
define service{
use generic-service
host_name pve-cluster
service_description Qemu VMs
check_command check_pve_cluster_qemu
}
define service{
use generic-service
host_name pve-cluster
service_description Storages
check_command check_pve_cluster_storage
}