Querying Alarms using a REST API
search cancel

Querying Alarms using a REST API

book

Article ID: 226446

calendar_today

Updated On:

Products

DX Operational Intelligence DX Application Performance Management DX OI SaaS DX APM SaaS

Issue/Introduction

How to query for Alarms using postman? 

Environment

  • DX OI SaaS 
  • DX OI 2x on-premise

 

Resolution

STEP 1: Generate a Tenant token

Two options available:

a) Go to Settings > Manage Tokens

b) Go to Cluster Management > Tenant> Create a Tenant Token

STEP 2: Query for Alarms

Syntax

GET http(s)://<apmgateway>:<port>/oipublic/aoanalytics/alarms/alarms_all/_search?q=<query string>

Authorization: Bearer Token <tenant token>

for example to query SaaS NA: https://apmgw.dxi-na1.saas.broadcom.com:443/oipublic/aoanalytics/alarms/alarms_all/_search?q=<query string>

NOTE: The search Query should be encoded format, you can encode the query parameters using a tool such as https://www.urldecoder.org/ 

 

Available Filter Operators : 

AND, OR, NOT 

Also can use wildcards in the values(*) 

 

Examples

1. Filter APM Critical Alarms only

- Plain text format:

product:"Application Performance Management" AND (severity:critical)AND (status:NEW OR status:UPDATED)

- Encoded:

product%3A%22Application%20Performance% 20Management%22%20AND%20(severity%3Acritical)AND%20(status%3ANEW%20OR%20status%3AUPDATED)

- Here is an example of the complete URL to use in Postman 

https://apmgw.dxi-na1.saas.broadcom.com:443/oipublic/aoanalytics/alarms/alarms_all/_search?q=product%3A%22Application%20Performance% 20Management%22%20AND%20(severity%3Acritical)AND%20(status%3ANEW%20OR%20status%3AUPDATED)&from=0&size=1000 

 

2. Filter APM Anomaly alarms (Exclude using NOT) 

- Plain text format:

product:"Application Performance Management" AND (alarmType:(NOT Anomaly))AND (status:NEW OR status:UPDATED)

- Encoded:

product%3A%22Application%20Performance% 20Management%22%20AND%20(alarmType%3A(NOT%20Anomaly))AND%20(status%3ANEW%20OR%20status%3AUPDATED)

- Here is an example of the complete URL to use in Postman 

https://apmgw.dxi-na1.saas.broadcom.com:443/oipublic/aoanalytics/alarms/alarms_all/_search?q=product%3A%22Application%20Performance% 20Management%22%20AND%20(alarmType%3A(NOT%20Anomaly))AND%20(status%3ANEW%20OR%20status%3AUPDATED) &from=0&size=1000 

 

3. Filter Alarms based on Management Module 

- Plain text format:

product:"Application Performance Management" AND (management_module:TestDBMM)AND (status:NEW OR status:UPDATED)

- Encoded:

product%3A%22Application%20Performance% 20Management%22%20AND%20(management_module%3ATestDBMM)AND%20(status%3ANEW%20OR%20status%3AUPDATED)

- Here is an example of the complete URL to use in Postman, "TestMM" is the Management Module name to filter 

https://apmgw.dxi-na1.saas.broadcom.com:443/oipublic/aoanalytics/alarms/alarms_all/_search?q=product%3A%22Application%20Performance% 20Management%22%20AND%20(management_module%3ATestMM)AND%20(status%3ANEW%20OR%20status%3AUPDATED) &from=0&size=1000 

 

4. Other Attribute Examples  

alarm_name "(alarm_name:(frontend* OR backend*))AND "

Encoded value => (alarm_name%3A(frontend*%20OR%20backend*))AND%20


agent_process -> "(agent_process:ClusterDeployment)AND "

Encoded value => (agent_process%253AClusterDeployment)AND%20


component_name - > "(component_name: kube-system)AND "

Encoded value => (component_name%3A%20kube-system)AND%20 


Make sure append at the end an empty space (%20)

Additional Information