Skip to main content

Proxmox VE Rest API

Pack Assets​

Templates​

The Centreon Pack Proxmox VE brings a host template:

  • Virt-Proxmox-Ve-Restapi-custom

It brings the following service templates:

Service AliasService TemplateDefaultDiscovery
Node-UsageVirt-Proxmox-Ve-Node-Usage-RestapiXX
Storage-UsageVirt-Proxmox-Ve-Storage-Usage-RestapiXX
Vm-UsageVirt-Proxmox-Ve-Vm-Usage-RestapiXX

Discovery rules​

Rule NameDescription
Proxmox VMDiscover Proxmox virtual machines

More information about discovering hosts automatically is available on the dedicated page.

Collected metrics & status​

Metric nameDescriptionUnit
node statusCurrent overall node status
node_id#node.cpu.utilization.percentageCPU utilization%
node_id#node.memory.usage.bytesMemory usedB
node_id#node.filesystem.usage.bytesSpace used for root filesystemB
node_id#node.swap.usage.bytesSwap usedB

Prerequisites​

To monitor, a user with read privileges is required: VM.Monitor, VM.Audit, Datastore.Audit, Sys.Audit, Sys.Syslog.

Please refer to their official documentation: https://pve.proxmox.com/wiki/Proxmox_VE_API

Setup​

  1. Install the Centreon package on every Centreon poller expected to monitor Proxmox VE resources:
yum install centreon-plugin-Virtualization-Proxmox-Ve-Restapi
  1. On the Centreon web interface, install the Proxmox VE Centreon Pack on the Configuration > Monitoring Connector Manager page.

Configuration​

Host​

  • Log into Centreon and add a new host through Configuration > Hosts.
  • Fill the Name, Alias & IP Address / DNS fields according to your Proxmox VE server settings.
  • Apply the Virt-Proxmox-Ve-Restapi-custom template to the host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryNameDescription
XPROXMOXAPIPORTPort used (Default: 443)
XPROXMOXAPIPROTOSpecify http if needed (default: 'https')
XPROXMOXAPIUSERNAMEApi username
XPROXMOXAPIPASSWORDApi password
XPROXMOXAPIREALMApi username realm
PROXMOXAPIEXTRAOPTIONSAny extra option you may want to add to the command (eg. a --verbose flag)

How to check in the CLI that the configuration is OK and what are the main options for?​

Once the plugin is installed, log into your Centreon poller's CLI using the centreon-engine user account (su - centreon-engine) and test the plugin by running the following command:

/usr/lib/centreon/plugins/centreon_proxmox_ve_restapi.pl \
--plugin=apps::proxmox::ve::restapi::plugin \
--mode=storage \
--hostname='10.0.0.1' \
--port='443' \
--proto='https' \
--api-username='my-username' \
--api-password='my-password' \
--realm='my-realm' \
--verbose

The expected command output is shown below:

OK: Storage 'storage/nuc/local' state: available, space total: 217.61 GB used: 145.86 GB (67.03%) free: 71.76 GB (32.97%) | 'storage/nuc/local#storage.space.usage.bytes'=156610641920B;;;0;233658822656

All available options for a given mode can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins/centreon_proxmox_ve_restapi.pl \
--plugin=apps::proxmox::ve::restapi::plugin \
--mode=storage \
--help

All available modes can be displayed by adding the --list-mode parameter to the command:

/usr/lib/centreon/plugins/centreon_proxmox_ve_restapi.pl \
--plugin=apps::proxmox::ve::restapi::plugin \
--list-mode

Troubleshooting​

Please find the troubleshooting documentation for the API-based plugins in this chapter.