EV Observe - Use Global-Api-Value and Global-Api-Status Service Templates

Last modified on 2023/07/06 12:48

The Global-Api-Value and Global-Api-Status service templates monitor any JSON REST API generically. They are used to process the numeric and text values returned and compare them with the expected thresholds or values.

You can set up authentication by calling an endpoint different from the final endpoint.

Notes

  • Both service templates only support JSON REST APIs.
  • They only support the None, OAuth and Basic authentication protocols.
  • An endpoint is a uniform resource locator found at the end of the URL that can be called with parameters using the GET (read) and POST (write) methods.

example  http://myservice.com/v3/token - call API: http://myservice.com/v3/jobs

  • URL = http://myservice.com/v3
  • EndPoint Authentication = /token
  • Endpoint = /jobs

Procedure: How to use the service templates

SelectCompanyInCompanyTree_Procedure

1. Go to the Web app.

2. Select the company from the company tree structure.

Notes:

  • The selected company must be associated with a Box.
  • You can create a new company. Open url.png See the procedure

    Company tree structure.png

3. Create a new service.

  • Select Configuration > Services > List in the menu.
  • Click + Add in the Mode: Box tab.

4. Specify the information below.

General information tab
      Global-Api-Value-Status configuration.png

  • Service template: Select the relevant template, Global-Api-Value or Global-Api-Status.
  • Name: Enter the name of the new service to be created. Its name should correspond to the event to be captured.

    example  Link Down

     

Availability and checks tab
        Global-Api-Value-Status configuration - Availability and checks tab.png

  • Specify the credentials if the API requires authentication via an endpoint different from the final endpoint, e.g. OAuth or APIs requiring a token, visa or some similar element for the call.
     Open url.png See the use case

5. Click Validate.

Use case

Call the Veeam Backup for Microsoft 365 REST API

  • These use cases help you configure the Global-Api-Value and Global-Api-Status service templates if you want to use the Veeam Backup for Microsoft 365 REST API.
  • The Veeam Backup for Microsoft 365 REST API is based on OAuth authentication.

Configuration for calling the Jobs endpoint

     Open url.png See the relevant Veeam Backup REST API documentation

To call the Jobs endpoint, a token must be provided. It will be collected when calling the endpoint authentication and cached with a validity period passed in a parameter. It is retrieved using the endpoint authentication.

          Use case API Veeam - Call endpoint jobs.png

Configuration of the endpoint authentication

  • URL = https://abc.tech.local:4443/v5
  • ID = xxxx
  • Password = yyyy
  • EndPoint Authentication = /token
  • Authentication method = POST
  • Authentication header = Content-Type: application/x-www-form-urlencoded
  • Authentication body = grant_type=password&username=%login%&password=%password%
    • %login% and %password% are used to retrieve the value of the ID field from EV Observe and leverage the management of monitoring accounts.

Caution: You must not replace the password in grant_type=password. It is used to indicate the authentication type for the API (API developer's choice).

  • Identification field: access_token
    • This is the field name that returns the required value for the next call.
    • Only the field name is specified because it is at the direct root of the response, i.e. JSON level 1.
  • Cache validity = 60

Configuration for retrieving the last backup job status

     Open url.png See the relevant Veeam Backup REST API documentation

          Use case API Veeam - Retrieve last status #1.png

Configuration of the endpoint authentication

  • Endpoint = /Jobs
  • Method = GET
  • Header = Authorization: Bearer %auth%
    • %auth% will automatically be replaced by the value retrieved from Identification field in the previous call.

The API will return a table containing information on each backup job. The service template will analyze each element in the table based on the configuration below.

  • EndPoint = {empty}
    • Used to go to the start of the table. In our example, the API returns the table directly. As such, the value is {empty}.
  • Filter = name
    • This is the name of the backup job. 
    • The filter (white and black lists) is applied to the job names.
  • Values = lastStatus
    • This is the field whose returned value is included in the analysis (thresholds or text).

Configuration for obtaining the last status in the service

  • The API will return a table containing information on the last three executions for each backup job. The service template will analyze each element in the table based on the configuration below.

Note : In our examples, the values identify the position within the table.

API result Configuration of the endpoint authentication
Use case API Veeam - Retrieve last status #2.png
  • EndPoint = table
    • Used to go to the level of the table that will become the new starting point of the analysis scope.
  • Filter = Information>name
    • The job name is found in the Information level of the analysis scope.
  • Value = Result>lastStatus
    • The job status is found in the Result level of the analysis scope.
Use case API Veeam - Retrieve last status #3.png
  • EndPoint = {empty}
    • Used to go to the start of the table.
  • Filter = name
    • This is the name of the backup job.
    • The filter (white and black lists) is applied to the job names.
  • Value = lastresults>2>executionstatut
    • lastresults: Used to go to the lastresults level of the table.
    • 2: Used to retrieve the third value (a table always starts with zero 0).
    • Retrieve the value associated with executionstatut.

or

  • Value = lastresults>-1>executionstatut
    • Used to retrieve the last value of the table (-2 for the second to last value)
Use case API Veeam - Retrieve last status #4.png
  • EndPoint = {empty}
    • Used to go to the start of the table.
  • Filter = name
    • This is the name of the backup job.
    • The filter (white and black lists) is applied to the job names.
  • Value = lastresults>2>1
    • lastresults: Used to go to the lastresults level of the table.
    • 2: Used to retrieve the third value (a table always starts with zero 0) and go to a new table.
    • 1: Used to retrieve the second value of the previous table.

Configuration using a regex

  • The API will return a table containing fan temperatures for each host. The service template will analyze each element in the table based on the configuration below.
  • A regex is used to obtain fan temperatures as a numeric value.
API result Configuration of the endpoint authentication
Use case API Veeam - Retrieve equipment temperature.png
  • EndPoint = {empty}
    • Used to go to the start of the table.
  • Filter = name
    • This is the name of the fan.
    • The filter (white and black lists) is applied to the fan names.
  • Value = Temperature
    • Used to retrieve the temperature as a text value, instead of a numeric value, with the C character (for Celsius).
    • If you only want to keep the numeric value, you must use a regex: [0-9]+.
Tags:
Powered by XWiki © EasyVista 2024