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

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 in case Optional Body parameters are not considered.

Example if Optional Body parameters are considered.

{

"entityType":"organizationUnit",

"entityValue":"finance_dept"

}

Body

Optional:

{

"entityType": "organization/organizationUnit",

"entityValue": "name of the organization/organizationUnit"

}

Note:

  • Administrators can apply the entityType as 'organizationUnit' only for the Enterprise edition of eG manager.

  • In SaaS deployment of eG manager, user with OrgAdmin role can apply the entityType as 'organizationUnit' alone.

  • In SaaS deployment of eG manager, a user with administrator role is alone entitled to use both entityType and entityValue parameters.

Success Response
Type Code Example Response

JSON

200

{

"total":159,

"critical": 47,

"major": 42,

"minor":70

}

 

Failure Response
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."}

Retrieving Count of Current Alarms Using Postman REST Client

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.

Retrieving Count of Current Alarms Using cURL

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