Skip to main content

Versa Director Restapi

Overview​

Versa Director provides the management, monitoring and orchestration capabilities needed to deliver Versa’s VNF-based network and security services.

The Centreon Monitoring Connector relies on the Versa Director API to query and collect status and metrics of the Versa equipments managed by the Director.

You can find more information about the Versa Director API on the official documentation: https://apidocs.versa-networks.com/

Monitoring Connector assets​

Monitored objects​

  • Versa Networks devices

Discovery Rules​

Rule NameDescription
Net-Versa-Director-Restapi-HostDiscovery-devicesDiscover and monitor Versa Devices managed by Versa Director

Collected metrics​

  • Global
Metric nameDescriptionUnit
statusStatus of the device
memory.usage.bytesMemory usage on the deviceB
memory.free.bytesFree memory on the deviceB
memory.usage.percentagePercentage of memory usage on the device%
disk.usage.bytesDisk usage on the deviceB
disk.free.bytesFree disk space on the deviceB
disk.usage.percentagePercentage of disk usage on the device%
alarms.critical.countNumber of critical alarms on the deviceCount
alarms.major.countNumber of major alarms on the deviceCount
alarms.minor.countNumber of minor alarms on the deviceCount
alarms.warning.countNumber of warning alarms on the deviceCount
alarms.indeterminate.countNumber of indeterminate alarms on the deviceCount
policy.violation.packets.dropped.novalidlink.countNumber of packets dropped by no valid linkCount
policy.violation.packets.dropped.slaaction.countNumber of packets dropped by sla actionCount
  • Per health monitor. monitor-name are 'bgp', 'config', 'ike', 'interface', 'port', 'path', 'reachability', 'service'.
Metric nameDescriptionUnit
<monitor-name>.health.up.countNumber of health monitors upCount
<monitor-name>.health.disabled.countNumber of health monitors disabledCount
<monitor-name>.health.down.countNumber of health monitors downCount

Prerequisites​

Device Configuration​

The API must be enabled and running on the Versa Director device. Please refer to the manufacturer documentation to achieve this.

Network flows​

The Centreon Poller must be able to reach the TCP/9182 HTTPS port of the Versa Director device.

Installation​

  1. Install the Centreon package on every Centreon Poller expected to monitor Versa devices trough Versa Director API:
yum install centreon-plugin-Network-Versa-Director-Restapi
  1. On the Centreon Web interface, install the Versa Director Restapi Monitoring Connector through Configuration > Monitoring Connector Manager page.

Host configuration​

  • Log into Centreon and add a new Host through "Configuration > Hosts".
  • Apply the template Net-Versa-Director-Device-Restapi-custom and configure all the mandatory Macros:
MandatoryNameDescription
XDIRECTORAPIPORTPort used. Default: 9182
XDIRECTORAPIPROTOProtocol used. Default: https
XDIRECTORAPIORGANIZATIONLinked organizations of the device. Default: .*
XDIRECTORAPIHOSTNAMEHostname of the Versa Director.
XDIRECTORAPIUSERNAMEUsername to access to the API.
XDIRECTORAPIPASSWORDPassword to access to the API.
XDIRECTORAPIDEVICENAMEName of the Versa device.
DIRECTORAPIEXTRAOPTIONSAny extra option you may want to add to the command (eg. a --verbose flag)
PROXYURLProxy URL. (eg. http://myproxy.int:3128)

Use the discovery module to add the monitoring of your Versa devices. Go to Configuration > Host > Discovery and use the provider Versa Networks devices (Director RestAPI)

FAQ​

How to test the Plugin and what are the main options for ?​

Once the Plugin installed, log into your Centreon Poller CLI using the centreon-engine user account and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_versa_director_restapi.pl \
--plugin=network::versa::director::restapi::plugin \
--mode=devices \
--hostname=10.0.0.1 \
--port='9182' \
--proto='https' \
--api-username='jdoe' \
--api-password='6fbadZEJbsLG' \
--organization='.*' \
--filter-device-name='^CENFRGW101$' \
--warning-status='' \
--critical-status='%{ping_status} ne "reachable" or %{services_status} ne "good"' \
--verbose

Expected command output is shown below:

OK: Device 'CENFRGW101' status services: good [ping: reachable] [sync: in_sync] [path: unavailable] [controller: unavailable] -
memory total: 31.42 GB used: 11.49 GB (36.57%) free: 19.93 GB (63.43%) - disk total: 250.00 B used: 18.00 B (7.20%) free: 232.00 B (92.80%) -
alarms critical: 0, major: 0, minor: 0, warning: 0, indeterminate: 0 -
policy violation packets-dropped-novalidlink : 0, packets-dropped-slaaction : 0 -
all health monitors are ok | 'devices.total.count'=1;;;0; 'CENFRGW101#memory.usage.bytes'=12337293557B;;;0;33736968110.08
'CENFRGW101#memory.free.bytes'=21399674552B;;;0;33736968110.08 'CENFRGW101#memory.usage.percentage'=36.57;;;0;100
'CENFRGW101#disk.usage.bytes'=18B;;;0;250 'CENFRGW101#disk.free.bytes'=232B;;;0;250
'CENFRGW101#disk.usage.percentage'=7.20;;;0;100 'CENFRGW101#alarms.critical.count'=0;;;0;
'CENFRGW101#alarms.major.count'=0;;;0; 'CENFRGW101#alarms.minor.count'=0;;;0; 'CENFRGW101#alarms.warning.count'=0;;;0;
'CENFRGW101#alarms.indeterminate.count'=0;;;0; 'CENFRGW101~bgp adjacencies#health.up.count'=3;;;0;3
'CENFRGW101~bgp adjacencies#health.down.count'=0;;;0;3 'CENFRGW101~bgp adjacencies#health.disabled.count'=0;;;0;3
'CENFRGW101~config sync status#health.up.count'=1;;;0;1 'CENFRGW101~config sync status#health.down.count'=0;;;0;1
'CENFRGW101~config sync status#health.disabled.count'=0;;;0;1 'CENFRGW101~ike status#health.up.count'=2;;;0;2
'CENFRGW101~ike status#health.down.count'=0;;;0;2 'CENFRGW101~ike status#health.disabled.count'=0;;;0;2
'CENFRGW101~interfaces#health.up.count'=3;;;0;3 'CENFRGW101~interfaces#health.down.count'=0;;;0;3
'CENFRGW101~interfaces#health.disabled.count'=0;;;0;3 'CENFRGW101~paths#health.up.count'=24;;;0;24
'CENFRGW101~paths#health.down.count'=0;;;0;24 'CENFRGW101~paths#health.disabled.count'=0;;;0;24
'CENFRGW101~physical ports#health.up.count'=0;;;0;0 'CENFRGW101~physical ports#health.down.count'=0;;;0;0
'CENFRGW101~physical ports#health.disabled.count'=0;;;0;0 'CENFRGW101~reachability status#health.up.count'=1;;;0;1
'CENFRGW101~reachability status#health.down.count'=0;;;0;1 'CENFRGW101~reachability status#health.disabled.count'=0;;;0;1
'CENFRGW101~service status#health.up.count'=1;;;0;1 'CENFRGW101~service status#health.down.count'=0;;;0;1
'CENFRGW101~service status#health.disabled.count'=0;;;0;1
checking device 'CENFRGW101' [type: hub]
status services: good [ping: reachable] [sync: in_sync] [path: unavailable] [controller: unavailable]
memory total: 31.42 GB used: 11.49 GB (36.57%) free: 19.93 GB (63.43%)
disk total: 250.00 B used: 18.00 B (7.20%) free: 232.00 B (92.80%)
alarms critical: 0, major: 0, minor: 0, warning: 0, indeterminate: 0
policy violation packets-dropped-novalidlink : 0, packets-dropped-slaaction : 0
health monitor 'bgp adjacencies' up: 3, down: 0, disabled: 0
health monitor 'config sync status' up: 1, down: 0, disabled: 0
health monitor 'ike status' up: 2, down: 0, disabled: 0
health monitor 'interfaces' up: 3, down: 0, disabled: 0
health monitor 'paths' up: 24, down: 0, disabled: 0
health monitor 'physical ports' up: 0, down: 0, disabled: 0
health monitor 'reachability status' up: 1, down: 0, disabled: 0
health monitor 'service status' up: 1, down: 0, disabled: 0

The command above monitors a Versa Networks device CENFRGW101 (--filter-device-name='^CENFRGW101$') trough the Versa Director API (--plugin=network::versa::director::restapi::plugin --mode=devices). It connects to the Versa Director host 10.0.0.1 (--hostname=10.0.01) using the user jdoe and its password (--api-username='jdoe' --api-password='6fbadZEJbsLG'). The device can be under several organizations, so we use a wildcard (--organization='.*').

This command will trigger a CRITICAL alarm (--critical-status='%{ping_status} ne "reachable" or %{services_status} ne "good"') if:

  • the 'ping status' of the device is not reachable
  • the 'service_status' of the device is not good

Some thresholds can also be set on metrics with options --warning-* and --critical-*.

For each Plugin mode, all the options as well as all the available thresholds can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins/centreon_versa_snmp.pl \
--plugin=network::versa::director::restapi::plugin \
--mode=devices \
--help

Why do I get the following error:​

UNKNOWN: 500 Can't connect to myversadirector:9182​

This error message means that the Centreon Plugin couldn't successfully connect to the Versa Director API. Check that no third party device (such as a firewall) is blocking the request. A proxy connection may also be necessary to connect to the API. This can be done by using the --proxyurl option in the command.

UNKNOWN: 501 Protocol scheme 'connect' is not supported |​

When using a proxy to connect to the Versa Director API, this error message means that the Centreon Plugin library does not support the proxy connection protocol. In order to prevent this issue, use the curl HTTP backend by adding the following option to the command: --http-backend='curl'.

UNKNOWN: Cannot load module 'Net::Curl::Easy'​

This error message means that a Perl library required to use the curl backend is missing. In order to fix this issue, install the Net::Curl::Easy Perl library using the following command:

yum install perl-Net-Curl