Skip to main content

Skylight PVX

Overview​

Every PVX-Skylight instance provides XML API endpoints allowing Centreon to perform queries against it.

architecture

Pack Assets​

Templates​

The Centreon Monitoring Connector PVX brings 1 host template:

  • App-Pvx-Application-Restapi-custom

It brings the following Service Templates:

Service AliasService TemplateService DescriptionDefault
Http-Hits-ApplicationApp-Pvx-Http-Hits-Application-RestapiCheck the number of HTTP errorsX
Http-HitsApp-Pvx-Http-Hits-RestapiCheck the number of HTTP errors
Http-Hits-Server-IpApp-Pvx-Http-Hits-Server-Ip-RestapiCheck the number of HTTP errors
Network-Connection-ApplicationApp-Pvx-Network-Connection-Application-RestapiCheck the connections attempsX
Network-ConnectionApp-Pvx-Network-Connection-RestapiCheck connections attemps
Network-Connection-Server-IpApp-Pvx-Network-Connection-Server-Ip-RestapiCheck the connections attemps
Network-Traffic-ApplicationApp-Pvx-Network-Traffic-Application-RestapiCheck traffic by application.X
Network-Traffic-LayerApp-Pvx-Network-Traffic-Layer-RestapiCheck traffic by layer.
Network-TrafficApp-Pvx-Network-Traffic-RestapiCheck traffic by instance
Network-Traffic-Server-IpApp-Pvx-Network-Traffic-Server-Ip-RestapiCheck traffic by IP
Network-User-Experience-ApplicationApp-Pvx-Network-User-Experience-Application-RestapiCheck the user experience by application.X
Network-User-ExperienceApp-Pvx-Network-User-Experience-RestapiCheck the user experience by instance
Network-User-Experience-Server-IpApp-Pvx-Network-User-Experience-Server-Ip-RestapiCheck the user experience by IP

Collected metrics & status​

Metric NameUnit
instances#http.hits.persecondhits/s
instances#http.hits.error.persecondhits/s
instances#http.hits.percentage

Prerequisites​

Compatibility​

The connector has been tested with the following versions: * PVX version 5.1.1

PVX API​

To query PVX API, you need to generate an access key. This key will never expire and the procedure below is an extract from the official documentation. In each step replace the value of the macros enclosed by '< >' with yours.

curl -k 'https://**<pvxapihost>**/api/login?user=**<user>**&password=**<password>**'`

Result:

{
"type": "result",
"result": "**session:91554086-842b-4b73-9028-c51d20d91b94**"
}

Thanks to the obtained session ID, execute the command below get a secret key

curl -k 'https://**<pvxapihost>**/api/create-api-key?name=**<keyname>**&_session=session:91554086-842b-4b73-9028-c51d20d91b94'`

Result:

{
"type": "result",
"result": "**secret:e40b1cc6-f629-43a4-8be6-14a9c9f036e0**"
}

In this example the API key is "secret:e40b1cc6-f629-43a4-8be6-14a9c9f036e0".

Setup​

  1. Install the Centreon package on every Centreon poller expected to monitor PVX resources:
yum install centreon-plugin-Applications-Pvx-Restapi
  1. On the Centreon Web interface, install the PVX Centreon Monitoring Connector 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 PVX server settings.
  • Select the App-Pvx-Application-Restapi-custom template to apply to the Host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryMacroDescription
PVXAPIEXTRAOPTIONSAny extra option you may want to add to every command_line (eg. a --verbose flag)
XPVXAPIHOSTNAMEPVX hostname
XPVXAPIKEYPVX API key
PVXAPIPORT(Default: '443')
PVXAPIPROTO(Default: 'https')
PVXAPIURLPATH(Default: '/api')
PVXCUSTOMMODE(Default: 'api')

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 CLI using the centreon-engine user account (su - centreon-engine) and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_pvx_restapi.pl \
--plugin=apps::pvx::restapi::plugin \
--mode=http-hits \
--custommode='api' \
--hostname='10.0.0.1' \
--url-path='/api' \
--api-key='' \
--port='443' \
--proto='https' \
--timeframe='3600' \
--instance='' \
--warning-ratio='' \
--critical-ratio='' \
--warning-hits-error='' \
--critical-hits-error='' \
--warning-hits='40' \
--critical-hits='60' \
--use-new-perfdata

The expected command output is shown below:

OK: ratio: 18 hits error: 2 hits/s hits: 39 hits/s | 'http.hits.percentage'=18;;;0; 'http.hits.error.persecond'=2hits/s;;;0; 'http.hits.persecond'=39hits/s;0:40;0:60;0; 

This command would trigger a WARNING alarm if the HTTP hits count is reported as over 40 (--warning-hits='40') and a CRITICAL if over than 60 (--critical-hits='40') in the last hour (--timeframe='3600').

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

/usr/lib/centreon/plugins//centreon_pvx_restapi.pl \
--plugin=apps::pvx::restapi::plugin \
--mode=http-hits \
--help

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

/usr/lib/centreon/plugins//centreon_pvx_restapi.pl \
--plugin=apps::pvx::restapi::plugin \
--list-mode

Troubleshooting​

Please find all the troubleshooting documentation for the API-based Plugins in the dedicated chapter of the Centreon documentation.