Services API

Overview

The Services API lets you programmatically retrieve data about the health of the IT services that you monitor with Nexthink.

The client of the Services API must trust the certificate in the primary Appliance (the Portal).

To authenticate the client, the Service API uses Basic Authentication. Nexthink recommends creating a local account to exclusively authenticate clients of the API.

Enabling the Services API

The Services API is fully tested and can be used in production. However, it is still in the phase of technical preview and you need to activate the feature before being able to use it.

To enable the Services API:

  1. Log in to the CLI of the Portal Appliance.

  2. Optional: If the Portal has no configuration file yet, that is, if portal.conf does not exist in folder /var/nexthink/portal/conf, create it by copying the defaults from the sample configuration file:

sudo -u nxportal cp /var/nexthink/portal/conf/portal.conf.sample \ /var/nexthink/portal/conf/portal.conf

3. Edit the Portal configuration file:

sudo vi /var/nexthink/portal/conf/portal.conf

4. Add the following line:

globalconfig.feature.service-test-api = true​

5. Save your changes and exit:

:wq

6. Restart the Portal to apply your settings:

sudo systemctl restart nxportal

Finding out available service data

To interactively look for service data that is available through the Services API:

  1. Navigate with a web browser to the following address:

    https://<Portal_DNS_FQDN>/api/beta/services
  2. Log in to the discovery tool of the Services API:

    • Type in the user credentials whenever asked by the web browser.

    • The discovery tool displays the service data limited to the view domain of the user in the hierarchy.

Querying the API

To query the Services API, send a GET request to the API URL with the following parameters:

  • Include either the hierarchy-level or the path parameter in a Services API query, but not both simultaneously.

Example of a query URL:

https://<Portal_DNS_FQDN>/api/beta/service/data/overview?​
metric=57dc824c-3507-434a-9658-2d98255c1eff&​
hierarchy=Location&​
path=Europe&path=Switzerland&​
format=table​

The Services API uses Basic Authentication. To test the API from a Nexthink appliance, you can use curl, for instance:

curl https://<Portal_DNS_FQDN>/api/beta/service/data/overview?... -u username:password

Output of the Services API

The data that you can retrieve from the Services API is similar to what you get when analyzing the health of a service from the corresponding dashboards in the Portal.

Find below the complete list of outputs of the Services API:


RELATED TASKS

RELATED CONCEPT

Last updated