Project: Centreon (Observability and Analysis / Observability)
File: newtest.md

This module aims to retrieve Newtest services. It uses the Newtest webservice in order to connect and retrieve the informations of one (or more) Newtest Management Console (NMC). By default newtest starts X processes (it depends of the configuration). Here are the steps done by one process: Centreon configuration: get the robots and scenarios already configured, Get the list of robots and scenarios from the NMC, Create the needed configuration in Centreon with CLAPI (no disable or delete actions), Get the last status of scenarios from the NMC, Submit the result to Centreon through centcore. | Dependency | Version | Repository | | :-- | :-: | :-- | | perl-SOAP-Lite | 1.10 | centreon base | | perl-TimeDate | 2.30 | redhat/centos base | | Directive | Description | Default value | | :- | :- | :- | | clapi_command | Path to the CLAPI binary | `/usr/bin/centreon` | | clapi_timeout | Time in seconds before CLAPI command execution is considered timed out | `10` | | clapi_username | CLAPI username | | | clapi_password | CLAPI username's password | | | centcore_cmd | Path to centcore command file | `/var/lib/centreon/centcore.cmd` | | clapiactionapplycfg | CLAPI action used to apply Poller configuration | | | clapigenerateconfig_timeout | Time in seconds before the configuration generation is considered timed out | `180` | | checkcontainerstime | Time in seconds between two containers synchronisation | `3600` | ```yaml name: newtest package: "gorgone::modules::plugins::newtest::hooks" enable: false checkcontainerstime: 3600 clapi_command: /usr/bin/centreon clapi_username: admin clapi_password: centreon clapiactionapplycfg: POLLERRELOAD centcore_cmd: /var/lib/centreon/centcore.cmd ``` Add an entry in the containers table with the following attributes per NWC definition: | Directive | Description | | : | :- | | name | Name of the NWC configuration entrie | | resync_time | Time in seconds between two NWC/Centreon synchronisations | | nmc_endpoint | Address of the NMC endpoint | | username | Username to connect to NWC endpoint | | password | Username's password | | host_template | Host template used when the daemon creates a host in Centreon | | host_prefix | Name used when the daemon creates and looks for a host in Centreon | | service_template | Service template used when the daemon creates a host in Centreon | | service_prefix | Name used when the daemon creates and looks for a service in Centreon | | poller_name | Poller used when the daemon creates a host in Centreon | | listscenariostatus | Informations to look for from the NWC endpoint | ```yaml containers: name: nwc_1 resync_time: 300 nmcendpoint: "http://NMCADDRESS/nws/managementconsoleservice.asmx" username: user password: pass host_template: generic-active-host-custom host_prefix: Robot-%s service_template: generic-passive-service-custom service_prefix: Scenario-%s poller_name: Central listscenariostatus: '{ "search": "All", "instances": [] }' name: nwc_2 resync_time: 600 nmcendpoint: "http://NMCADDRESS/nws/managementconsoleservice.asmx" username: user password: pass host_template: generic-active-host-custom host_prefix: Robot-%s service_template: generic-passive-service-custom service_prefix: Scenario-%s poller_name: Central listscenariostatus: '{ "search": "Robot", "instances": ["XXXX"] }' ``` | Event | Description | | :- | :- | | NEWTESTREADY | Internal event to notify the core | | NEWTESTRESYNC | Synchronise NWC and Centreon configuration | | Endpoint | Method | | :- | :- | | /plugins/newtest/resync | `GET` | | Header | Value | | :- | :- | | Accept | application/json | ```bash curl --request GET "https://hostname:8443/api/plugins/newtest/resync" \ --header "Accept: application/json" ``` It is possible to get this kind of error in logs of newtest: ```bash die: syntax error at line 1, column 0, byte 0 at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/XML/Parser.pm line 189 ``` It often means that a timeout occur.