Retrieving Count of Alarms Raised in the Target Environment

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

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

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

Not Applicable

 

Success Response
Type Code Example Response

JSON

200

{

"TOTAL": 43,

"CRITICAL": 7,

"MAJOR": 13,

"MINOR": 23

}

 

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 current alarm count using Postman REST Client

Retrieving Count of Alarms Raised in the Target Environment using cURL

To retrieve the count of 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/getAlarmCount" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "managerurl:http://<eG Manager IP:Port>" --data-raw ""

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

Figure 2 : Retrieving current alarm count in the target environment using cURL