Retrieving Details of Current Alarms Raised in the Target Environment

By default, using the eG REST API, administrators can retrieve the count of current alarms raised in the eG manager as well as the detailed current alarms raised in the eG manager. The URL to retrieve the detailed current alarms should be in the following format:

URL:http://<eG manager IP:port>/api/eg/analytics/getAlerts

Method: POST

Content-Type: application/json

Inputs to be Specified
Parameters Key values Example

Headers

managerurl: Base URL of the eG Manager i.e., http://<IP address of the eG console:Port>

user: eG username or domain/eG username

pwd: Base64 encoded password

{

"type": "componentType",

"name": "Windows_server,eG_Manager"

}

Body

Default:

{

"type":"<zone/segment/service/componentType>",

"name":"<comma-separated list of zone/segment/service/componentType>"

}

 

 

Success Response
Type Code Example Response

JSON

200

{

"Total": 1,

"Summary": [

{

"Critical": 0,

"color": "#cd0f0f"

},

{

"Major": 0,

"color": "#fa9d1c"

},

{

"Minor": 1,

"color": "#ccc100"

}

],

"data": [

{

"Priority": "Minor",

"Component": "windows1",

"Description": "Memory utilized",

"test": "Memory Usage",

"measure": "Memory utilized",

"layer": "Operating System",

"Start Time": "09/17/2021 08:28:32"

}

],

"errorMsg": "-"

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

{"code": 401,"error": "Unauthorized user"}

JSON

500 Server Error

{"code": 500,"error": " Server Error "}

Figure 1 : Example to retrieve detailed current alarms using Postman REST Client

Retrieving Details of Current Alarms Raised in the Target Environment using cURL

To retrieve the details of current alarms in the target environment using cURL, the command should be specified in the following format:

curl -location -request POST "http://<eG Manager IP:Port>/api/eg/analytics/getAlerts" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "managerurl:http://<eG Manager IP:Port>" -d"{\"type\":\"zone/serivce/segment/componentType\",\"name\":\"comma-separated list of zone/service/segment/componentType\"}" -H "Content-Type:application/json" -s | more

Figure 2 shows an example of retrieving the details of current alarms raised in the target environment using cURL.

Figure 2 : Retrieving the details of current alarms in the target environment using cURL