Configuring REST API monitoring
Use the REST API monitor profile to track the availability, performance, and response validity of REST‑based services. The REST API monitor profile includes two server monitoring configurations:
- Authentication profile—Use the authentication profile to retrieve required values, such as tokens or API keys, from the authentication response and store them as variables. REST API monitoring then reuses these variables to authorize and execute subsequent REST API requests.
- REST API Configuration—Use this configuration to define the REST API that you want to monitor. This configuration specifies the REST API endpoint, request details, execution interval, and response validation rules. The REST API configuration reuses the variables (tokens or API keys) extracted from the Authentication profile when executing the request.
To configure Authentication Profiles
- Perform one of the following actions:
- In BMC Helix Operations Management, click Configuration > Monitoring Policies > Create Policy.
- In TrueSight Operations Management, click Configuration > Infrastructure Policies > Create Policy.
- Click Add Monitoring Configuration.
To configure the knowledge module, set the following preferences in the Add Monitoring Configuration dialog box:
Monitoring Solution
Monitor Profile
Monitor Type
Synthetic Monitoring
Synthetic Monitoring
REST API Monitoring
- In the Authentication Profiles section, click Add.
- Enter the authentication details as follows:
- In Profile name, enter a unique name that identifies the authentication configuration and is later referenced by the REST API configuration.
- In the Authentication type, select one of the following authentication methods used by the service:
- BASIC (default)
- API_KEY
- TOKEN
- In the Authentication Profile Input Variables, click Add and enter the following details to define values that must be sent to the authentication API:
- Auth Variable Name: Enter the name of the variable required by the authentication request
- Auth Variable Value: Enter the value for the authentication parameter
- In the Auth URL, enter the authentication endpoint used by the service.
- In the Auth method, select one of the following HTTP methods used by the authentication API:
- POST (default)
- GET
- In the HTTP version, select the required HTTP version supported by the service for sending the request:
- AUTO
- HTTP_1_X (default)
- ATTP_2
- Enter the authentication request details as follows:
- In the Auth headers (JSON), enter the required headers for the authentication request.
The header specifies how the authentication API processes the request, such as the content type or authorization information. - In the Auth payload (JSON) section, enter the authentication request body.
The payload contains the data that the authentication API needs to verify the request, such as access keys - In the Auth session TTL (seconds), specify how long the authentication result remains valid.
The default value is 3600.
The authentication request is re‑executed, and a new token is fetched in the following scenarios:- When the cached token exceeds the configured Auth session TTL (seconds).
- When the token expires before the configured TTL.
- When authentication profile settings (URL, method, headers, payload, or credentials) are modified.
- When authentication response extraction settings (variable name, regex, or group index) are modified.
- When the Auth session TTL value is updated.
When no cached token is available, such as during the first monitoring cycle or after cache invalidation.
- In the Auth headers (JSON), enter the required headers for the authentication request.
- In the Auth response extraction variables section, click Add.
Use Auth response extraction variables to capture values returned by the authentication response (for example, tokens or API keys) and reuse them when executing the REST API. Add the following Auth response extraction variable details:- In the Auth Extract Variable Name field, define a variable to store the extracted authentication response value, which can then be reused in the REST API configuration.
- In the Auth Extract Match Regex, enter the pattern used to locate the required value in the authentication response.
This pattern identifies the location of the value within the response, such as a token or identifier.
For example, if the authentication response contains "accessToken", enter the following value in the Match regex "accessToken"\s*:\s*"([^"]+)". - In the Auth Extract Group Index field, enter the number that identifies which part of the matched pattern contains the value to extract.
REST API monitoring extracts the value from the specified Auth Extract Group Index and stores it under the Variable name.
The default value is 1.
For example, if the match regex is "accessToken"\s*:\s*"([^"]+)", enter 1 to extract the value inside the parentheses. - Select the Mandatory Auth Extraction checkbox to make sure that REST API execution does not proceed unless the required value is successfully extracted from the authentication response.
- Click OK
- In the Authorization section, add the following details to provide credentials required by the REST API:
- User Name
- Password
- Confirm Password
Important: User Name and Password are required only when the Authentication type is Basic.
To configure REST API profile
- In the REST API configuration section, click Add.
- In the REST API display name, enter a unique name for this endpoint.
The input value must not contain any character from the set "=@\\&V". - In the REST API Input Template Variables section, click Add and specify a variable name and its value so REST API monitoring can replace the variable with the actual value when executing the REST API request:
- In Template Variable Name, enter the placeholder name that you want to use in the REST API request.
Use this format when referencing the variable:
{{variable_name}} - In Template Variable Value, enter the value that the REST API requires.
The REST API monitoring replaces {{variable_name}} with this value when the request is executed. - Click OK.
- In Template Variable Name, enter the placeholder name that you want to use in the REST API request.
- In the REST API Endpoint, enter the URL of the REST API you want to monitor.
- Configure the following fields to define how the REST API request is sent:
- In the Request method type, select one of the following HTTP methods used by the REST API:
- POST (default)
- GET
- In the HTTP version, select the required HTTP version supported for sending the request:
- AUTO
- HTTP_1_X (default)
- HTTP_2
- In the Request headers (JSON), reference authentication variables by using the following format:
{{auth_profile_name:variable_name}}
This reference links the REST API request to the authentication profile and causes REST API monitoring to run the authentication profile, retrieve the extracted value (such as a token), and use that value when executing the REST API request. - In the Request payload (JSON) field, enter the request body.
- In the Response format type field, select the required response format:
- JSON (default)
- XML
- TEXT
- In the Request timeout (sec), enter the maximum time to wait for a response before treating the request as timed out.
The default value is 30.The monitored REST API endpoint is executed at a fixed polling interval. By default, the REST API collector runs every 120 seconds (2 minutes). At each interval, the REST API request is executed, the response is validated, and monitoring metrics such as ResponseCode, ResponseTime, Availability, and MonitoringStatus are updated.
- In Follow web server redirects, select how REST API monitoring follows HTTP redirects returned by the API:
- NEVER (default)
- ALWAYS
- NORMAL
- In the Request method type, select one of the following HTTP methods used by the REST API:
- In the Response content match rules section, click Add. Configure the following response content match rules to verify that the REST API response contains the expected content:
- In the Rule name, enter a unique name to identify the content match rule.
- In the Match regex, enter the pattern used to locate the expected content in the REST API response.
- In the Capturing group index, enter the number that identifies which part of the matched pattern contains the value to evaluate. The default value is 1.
- Select the Mandatory match to treat the REST API response as valid only when the specified content is present.
- Select the Case sensitive checkbox to perform a case‑sensitive match when evaluating the response content.
- In the Authorization section, add the following details:
- User Name
- Password
- Confirm Password
- Configure response code validation to define how REST API monitoring evaluates HTTP status codes returned by the REST API:
- OK status code ranges—Specify the HTTP status code ranges that indicate a successful REST API response. The default value is 200-299,302.
- Warning status code ranges—Specify the HTTP status code ranges that indicate a warning condition when the REST API returns a response. The default value is 1-199,300-999.
- Configure the following proxy settings to allow REST API monitoring to access the REST API through a proxy server:
- In the Proxy host name/IP address, enter the proxy host name or IP address used to connect to the REST API.
- In the Proxy port number, enter the port number used by the proxy server.
- In the Proxy User Name and Proxy Password, enter the user name and password required to authenticate with the proxy server.
To configure Administration settings
- Configure the following Java runtime settings:
- In the JAVA Home (11 or above), enter the path to the Java installation used to execute REST API monitoring.
- In the JVM Arguments, enter JVM arguments to control Java runtime behavior, such as memory allocation or garbage collection settings.
- Select the Enable Debug checkbox to enable debug logging for REST API monitoring.
The log files are available at $PATROL_HOME%/stm/restapi/log directory - Configure the global proxy settings to access REST APIs through a proxy server.
- Select the Enable Annotation checkbox to include descriptive messages with REST API monitoring results.
Annotations provide additional context, such as response details or validation outcomes, to aid in the interpretation of monitoring data.
Important: To enable the Annotation option, the BMC Helix Operations Management metric-annotation service must be enabled.
- Select the Enable SSL Hostname Verification checkbox to enforce SSL host name verification when connecting to REST APIs over HTTPS.
Enabling this setting allows the Knowledge Module to validate the SSL certificate and perform host name verification. Disabling it bypasses SSL certificate validation, allowing connections to older systems that might not meet security requirements. Restart the PATROL Agent for changes to take effect.