Monitoring API HTTP Status with UIM Restmon
search cancel

Monitoring API HTTP Status with UIM Restmon

book

Article ID: 280748

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management On-Premise (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM)

Issue/Introduction

We have been consuming a massive amount of documentation in order to be able to monitor the http status of a particular API. So far we have created the json file and we are able to load it into UIM, but when configuring the template, we get a message indicating that the template is disabled.

Heres the json file we managed to put together, let us know what can we do in order to get this working:


{

 "createopp": {

 "urls": [

 {

 "xml_ns": "",

 "src": "",

 "var": "",

 "id": "BHDhttpstatus",

 "url": "/<hostname>/api/v1.1/crm/sales/<service_name>/<example>"

 }

 ],

 "definition": {

 "resource_category": null,

 "defaults": {

 "port": 8080,

 "interval": 10,

 "httptimeout": 30000,

 "headers": {

 "Authorization": "Bearer <api-token-to-be-added-here>"

 }

 },

 "auth": "bearer",

 "xml_ns": "",

 "name": "createopp",

 "type": "https"

 },

 "metrics": [

 {

 "calculation": "",

 "xml_ns": "",

 "attributes": {

 "uim": {

 "qos_name": "QOS_HTTP_STATUS",

 "qos_desc": "HTTP response status",

 "qos_abbr": "State",

 "metric_type": "2.2.2.2:2",

 "qos_unit": "State",

 "source": "%hostname",

 "target": "%urlid",

 "defaultpublishing": "true"

 }

 },

 "value": "$['httpstatus']",

 "url": "BHDhttpstatus",

 "group": "Connections"

 }

 ]

 }

}

Environment

  • DX UIM 20.4

Cause

  • json schema issues

There are a few issues found with the schema: 

  1. URL is wrong - "url": "/uimapi/swagger-ui/index.html" (It is an index page of uim swagger api but not an endpoint of UIM API)

  2. Wrong entry in Response header - "headers": {

                    "Authorization": "none"
                }

  1. Invalid section restapiconnectdetails

  2. "value": "$['httpstatus']" is incorrect as httpstatus is not available in the response.

  3. No accept type defined in the header. Looks like the default accept type of UIMAPI is xml, here we are accepting the response in json.

There are other issues as well so we created a sample schema with uimapi endpoints "/uimapi/hubs" and tested it in our lab environment. We are able to get the metric.

Please try the schema which is attached to this case and let us know if you have any questions. 

Note: There are different ways to handle the response in the value field so depending on the metric, we need to handle it.

Resolution

The customer developed a schema to collect the status of uimapi HTTP status code. They deployed the schema through the restmon interface and created a profile but the probe was unable to collect the qos with this profile.

During the schema analysis, we found that the schema itself had lots of issues. We created a test schema for the customer and tested in the 23.4 environment. It was working fine in the Broadcom lab.

The customer was using the DX UIM v23.4 environment. We deployed the Broadcom test schema and created a profile with it. The profile went into the Pending state and did not become Active.

We tried the following:

- Restarted MCS probe but it didn't work
- Deleted the profile and recreated it again but it didn't work, it again went into  Pending state
- To test the Broadcom-created schema we changed the schema from the backend in the previously created profile (old customer schema).  This is not a recommended method for customer it was just to validate the schema.
- The old profile started working and restmon probe started sending the qos messages but another new profile was still in a Pending state 
- In DrNimbus and the DB, the qos was not coming so we restarted the data engine but it didn't work.
- In the end, we asked the customer to reboot and cleanup the environment for redeployment of restmon schema. or use any other environment. 
- Customer chose to deploy the Broadcom schema in a new environment
- Profile was created and qos started coming in to DrNimbus and the database 
- We saw an issue with a metric view. Customer has 3 probes deployed on the environment but qos are coming on a metric view  for all probes.
- We validated the CM tables, they looked fine.
- Metric data is not inserting into the s_qos_snapshot table.
- Issue is still there for the metric view but qos are being collected from Restmon