Skip to main content

Absyss VTOM Rest API

Connector dependencies​

The following monitoring connectors will be installed when you install the Absyss VTOM Rest API connector through the Configuration > Connectors > Monitoring Connectors menu:

Pack assets​

Templates​

The Monitoring Connector Absyss VTOM Rest API brings a host template:

  • App-Vtom-Restapi-custom

The connector brings the following service templates (sorted by the host template they are attached to):

Service AliasService TemplateService DescriptionDiscovery
JobsApp-Vtom-Jobs-Restapi-customCheck jobsX

The services listed above are created automatically when the App-Vtom-Restapi-custom host template is used.

If Discovery is checked, it means a service discovery rule exists for this service template.

Discovery rules​

Service discovery​

Rule nameDescription
App-Vtom-Restapi-Job-NameDiscover jobs

More information about discovering services automatically is available on the dedicated page and in the following chapter.

Collected metrics & status​

Here is the list of services for this connector, detailing all metrics and statuses linked to each service.

NameUnit
jobs.running.countcount
jobs.errors.countcount
jobs.waiting.countcount
jobs.finished.countcount
jobs.notscheduled.countcount
jobs.descheduled.countcount
statusN/A
longN/A
jobs#job.success.percentage%

Prerequisites​

To control your VTOM, the Rest API must be configured.

The connector supports following authentication:

  • username/password
  • direct token

At least VTOM 6.6.1a is mandatory for the connector:

  • /auth/1.0/authorize
  • /monitoring/1.0/jobs/status

For previous VTOM version, please use legacy plugin mode.

Installer le connecteur de supervision​

Pack​

The installation procedures for monitoring connectors are slightly different depending on whether your license is offline or online.

  1. If the platform uses an online license, you can skip the package installation instruction below as it is not required to have the connector displayed within the Configuration > Connectors > Monitoring Connectors menu. If the platform uses an offline license, install the package on the central server with the command corresponding to the operating system's package manager:
dnf install centreon-pack-applications-vtom-restapi
  1. Whatever the license type (online or offline), install the Absyss VTOM Rest API connector through the Configuration > Connectors > Monitoring Connectors menu.

Plugin​

Since Centreon 22.04, you can benefit from the 'Automatic plugin installation' feature. When this feature is enabled, you can skip the installation part below.

You still have to manually install the plugin on the poller(s) when:

  • Automatic plugin installation is turned off
  • You want to run a discovery job from a poller that doesn't monitor any resource of this kind yet

More information in the Installing the plugin section.

Use the commands below according to your operating system's package manager:

dnf install centreon-plugin-Applications-Vtom-Restapi

Using the monitoring connector​

Using a host template provided by the connector​

  1. Log into Centreon and add a new host through Configuration > Hosts.
  2. Fill in the Name, Alias & IP Address/DNS fields according to your resource's settings.
  3. Apply the App-Vtom-Restapi-custom template to the host. A list of macros appears. Macros allow you to define how the connector will connect to the resource, and to customize the connector's behavior.
  4. Fill in the macros you want. Some macros are mandatory, in particular the macro for defining the custom mode, i.e. the connection method to the resource.
MacroDescriptionDefault valueMandatory
VTOMAPIUSERNAMEAPI usernameX
VTOMAPIPASSWORDAPI passwordX
VTOMAPITOKENUse token authentication directly
VTOMAPIPROTOSpecify https if neededhttps
VTOMAPIPORTPort used30002
VTOMCUSTOMMODEWhen a plugin offers several ways (CLI, library, etc.) to get information the desired one must be defined with this optionapi
VTOMAPIEXTRAOPTIONSAny extra option you may want to add to every command (a --verbose flag for example). All options are listed here.
  1. Deploy the configuration. The host appears in the list of hosts, and on the Resources Status page. The command that is sent by the connector is displayed in the details panel of the host: it shows the values of the macros.

Using a service template provided by the connector​

  1. If you have used a host template and checked Create Services linked to the Template too, the services linked to the template have been created automatically, using the corresponding service templates. Otherwise, create manually the services you want and apply a service template to them.
  2. Fill in the macros you want (e.g. to change the thresholds for the alerts). Some macros are mandatory (see the table below).
MacroDescriptionDefault valueMandatory
EXTRAOPTIONSAny extra option you may want to add to the command (a --verbose flag for example). All options are listed here.
  1. Deploy the configuration. The service appears in the list of services, and on the Resources Status page. The command that is sent by the connector is displayed in the details panel of the service: it shows the values of the macros.

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). Test that the connector is able to monitor a resource using a command like this one (replace the sample values by yours):

/usr/lib/centreon/plugins/centreon_vtom_restapi.pl \
--plugin=apps::vtom::restapi::plugin \
--mode=jobs \
--hostname='10.0.0.1' \
--api-username='my-username' \
--api-password='my-password' \
--filter-application='' \
--filter-environment='' \
--filter-name='' \
--verbose

The expected command output is shown below:

CRITICAL: job 'env_1/app_6/job_1' status: error [message: Traitement en erreur (1)] - job 'env_1/app_7/job_2' status: error [message: Traitement en erreur (1)] - job 'env_2/app_6/job_1' status: error [message: Traitement en erreur (1)] - job 'env_2/app_7/job_2' status: error [message: Traitement en erreur (1)] | 'jobs.running.count'=4;;;0;18 'jobs.errors.count'=4;;;0;18 'jobs.waiting.count'=4;;;0;18 'jobs.finished.count'=2;;;0;18 'jobs.notscheduled.count'=2;;;0;18 'jobs.descheduled.count'=2;;;0;18 'env_1~app_5~job_1#job.success.percentage'=100%;;;0;100 'env_2~app_5~job_1#job.success.percentage'=100%;;;0;100
job 'env_1/app_1/job_1' status: notscheduled
job 'env_1/app_2/job_1' status: waiting
job 'env_1/app_3/job_1' status: descheduled
job 'env_1/app_4/job_1' status: running [message: Job en cours d'execution, pid 29592 (ipid 210)], started since: 19h 37m 15s
job 'env_1/app_5/job_1' status: finished [message: Traitement termine (0)], success: 100.00 %
job 'env_1/app_6/job_1' status: error [message: Traitement en erreur (1)]
job 'env_1/app_7/job_1' status: running [message: L'agent nohost (nohost:37714) est ignore car une erreur recente a ete detectee (attente 63s)], started since: 19h 22m 52s
job 'env_1/app_7/job_2' status: error [message: Traitement en erreur (1)]
job 'env_1/app_7/job_3' status: waiting [message: Heure de demarrage non atteinte]
job 'env_2/app_1/job_1' status: notscheduled
job 'env_2/app_2/job_1' status: waiting
job 'env_2/app_3/job_1' status: descheduled
job 'env_2/app_4/job_1' status: running [message: Job en cours d'execution, pid 29651 (ipid 211)], started since: 19h 35m 58s
job 'env_2/app_5/job_1' status: finished [message: Traitement termine (0)], success: 100.00 %
job 'env_2/app_6/job_1' status: error [message: Traitement en erreur (1)]
job 'env_2/app_7/job_1' status: running [message: Impossible de se connecter a l'agent 'nohost' (nohost:37714) tentative 2/2], started since: 19h 26m 52s
job 'env_2/app_7/job_2' status: error [message: Traitement en erreur (1)]
job 'env_2/app_7/job_3' status: waiting [message: Heure de demarrage non atteinte]

Troubleshooting​

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

Available modes​

In most cases, a mode corresponds to a service template. The mode appears in the execution command for the connector. In the Centreon interface, you don't need to specify a mode explicitly: its use is implied when you apply a service template. However, you will need to specify the correct mode for the template if you want to test the execution command for the connector in your terminal.

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

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

The plugin brings the following modes:

ModeLinked service template
cache [code]App-Vtom-Cache-Restapi-custom
jobs [code]App-Vtom-Jobs-Restapi-custom
list-jobs [code]Used for service discovery

Available options​

Custom modes options​

All custom modes specific options are listed here:

OptionDescription
--memcachedMemcached server to use (only one server).
--redis-serverRedis server to use (only one server). Syntax: address[:port]
--redis-attributeSet Redis Options (--redis-attribute="cnx_timeout=5").
--redis-dbSet Redis database index.
--failback-fileFall back on a local file if Redis connection fails.
--memexpirationTime to keep data in seconds (default: 86400).
--statefile-dirDefine the cache directory (default: '/var/lib/centreon/centplugins').
--statefile-suffixDefine a suffix to customize the statefile name (default: '').
--statefile-concat-cwdIf used with the '--statefile-dir' option, the latter's value will be used as a sub-directory of the current working directory. Useful on Windows when the plugin is compiled, as the file system and permissions are different from Linux.
--statefile-formatDefine the format used to store the cache. Available formats: 'dumper', 'storable', 'json' (default).
--statefile-keyDefine the key to encrypt/decrypt the cache.
--statefile-cipherDefine the cipher algorithm to encrypt the cache (default: 'AES').
--http-peer-addrSet the address you want to connect to. Useful if hostname is only a vhost, to avoid IP resolution.
--proxyurlProxy URL. Example: http://my.proxy:3128
--proxypacProxy PAC file (can be a URL or a local file).
--insecureAccept insecure SSL connections.
--http-backendPerl library to use for HTTP transactions. Possible values are: lwp (default) and curl.
--hostnameSet hostname.
--portPort used (default: 30002)
--protoSpecify https if needed (default: 'https')
--api-usernameAPI username.
--api-passwordAPI password.
--tokenUse token authentication directly.
--timeoutSet timeout in seconds (default: 30).

Modes options​

All available options for each service template are listed below:

OptionDescription
--filter-countersOnly display some counters (regexp can be used). Example: --filter-counters='total-error'
--filter-environmentFilter environment name (cannot be a regexp).
--filter-applicationFilter application name (cannot be a regexp).
--filter-nameFilter name (can be a regexp).
--timezoneSet date timezone. Can use format: 'Europe/London' or '+0100'.
--warning-statusDefine the conditions to match for the status to be WARNING (default: -) You can use the following variables: %{name}, %{status}, %{exit_code}, %{message}, %{environment}, %{application}
--critical-statusDefine the conditions to match for the status to be CRITICAL (default: '%{exit_code} =~ /Error/i'). You can use the following variables: %{name}, %{status}, %{exit_code}, %{message}, %{environment}, %{application}
--warning-longSet warning threshold for long jobs (default: none) You can use the following variables: %{name}, %{status}, %{elapsed}, %{application}
--critical-longSet critical threshold for long jobs (default: none). You can use the following variables: %{name}, %{status}, %{elapsed}, %{application}
--warning-* --critical-*Thresholds. Can be: 'running', 'errors', 'waiting', 'finished', 'notscheduled', 'descheduled', 'success-prct'.

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

/usr/lib/centreon/plugins/centreon_vtom_restapi.pl \
--plugin=apps::vtom::restapi::plugin \
--mode=jobs \
--help