Retrieving Count 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. The URL to retrieve the count of current alarms should be in the following format:
URL:http://<eG manager IP:port>/api/eg/analytics/getAlarmCount
Method: POST
Content-Type: application/json
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 |
Type | Code | Example Response |
---|---|---|
JSON |
200 |
{ "total":159, "critical": 47, "major": 42, "minor":70 } |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{"code": 401,"error": "Invalid username or password."} |
JSON |
500 Server Error |
{"code": 500,"error": " Server Error. Please check /manager/logs/error_log in the installation directory for more information. "} |
Figure 1 : Example to retrieve current alarm count using Postman REST Client
Retrieving Count of Current 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 -L -X 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