Retrieving the History of Alarms Raised in the Target Environment

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

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

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

{

"component": "",

"type": "",

"timeline": "1 hour",

"priority": "",

"sortby": "Component Name",

"showAcknowledgements": "Yes"

}

Body

Default:

{

"type":"-1 or <Specific_Component_Type>", "component": " <"-1"> or <Specific_Component_Name>",

"timeline="<timeline in hours/days/weeks/minutes or Any>",

"sortby":"<Start Time or Component Name>", "showAcknowledgements": "Yes/No",

"priority": "All or Critical & Major or Critical or Major or Minor", "maxNoOfEventsPerAPICall": "<Number>"

}

 

Success Response
Type Code Example Response

JSON

200

{

"Summary": {

"Total": 63,

"Critical": 11,

"Major": 19,

"Minor": 33

},

"Problem Details": [

{

"priority": "Minor",

"layer": "Outside View of VMs",

"measure": "Is Xen tools installed?",

"Component_Type": "Citrix XenServer - VDI",

"Component_Name": "192.168.10.35",

"services": "-",

"test": "VM Tools Status - Xen",

"description": " Xen tools not installed in VM <span class='linkText'>SUPT-LINCNT6-32bit-(9.111)</span> on <span class='linkText'>Citrix XenServer - VDI</span> <span class='linkText'>192.168.10.35</span>",

"start date": "02-02-21 09:00",

"duration": "Current"

},

{

"priority": "Minor",

"layer": "Operating System",

"measure": "Usage of disk capacity",

"Component_Type": "Citrix XenServer - VDI",

"Component_Name": "192.168.10.35",

"services": "-",

"test": "Disk Space - Xen",

"description": " Usage of disk <span class='linkText'>CVAD-1909</span> on <span class='linkText'>Citrix XenServer - VDI</span> <span class='linkText'>192.168.10.35</span> is high",

"start date": "29-01-21 17:53",

"duration": "Current"

},

{

"priority": "Minor",

"layer": "Operating System",

"measure": "Usage of disk capacity",

"Component_Type": "Citrix XenServer - VDI",

"Component_Name": "192.168.10.35",

"services": "-",

"test": "Disk Space - Xen",

"description": " Usage of disk <span class='linkText'>WIN10-1809</span> on <span class='linkText'>Citrix XenServer - VDI</span> <span class='linkText'>192.168.10.35</span> is high",

"start date": "29-01-21 17:53",

"duration": "Current"

},

{

"priority": "Minor",

"layer": "Operating System",

"measure": "Usage of disk capacity",

"Component_Type": "Citrix XenServer - VDI",

"Component_Name": "192.168.10.35",

"services": "-",

"test": "Disk Space - Xen",

"description": " Usage of disk <span class='linkText'>pvs-2003</span> on <span class='linkText'>Citrix XenServer - VDI</span> <span class='linkText'>192.168.10.35</span> is high",

"start date": "29-01-21 17:53",

"duration": "Current"

},

{

"priority": "Minor",

"layer": "Operating System",

"measure": "Usage of disk capacity",

"Component_Type": "Citrix XenServer - VDI",

"Component_Name": "192.168.10.35",

"services": "-",

"test": "Disk Space - Xen",

"description": " Usage of disk <span class='linkText'>WIN-16</span> on <span class='linkText'>Citrix XenServer - VDI</span> <span class='linkText'>192.168.10.35</span> is high",

"start date": "29-01-21 16:47",

"duration": "Current"

},

.

.

.

.

.

]

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

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

JSON

500 Server Error

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

JSON

400 Bad Request

{ "code": 400, "error": " Bad Request. Please refer API documentation and add required parameters for this API." }

or

{

"code": 400,

"error": "Bad Request. Please give start date and end date if timeline is Any. Please refer API documentation"

}

Figure 1 : Example to retrieve the history of alarms using Postman REST Client

Retrieving History of Alarms Raised in the Target Environment using cURL

To retrieve the history 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/getAlarmsHistory" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "managerurl:http://<eG Manager IP:Port>" -H "Content-Type: application/json" --data-raw "{\"component\": \"\",\"type\": \"\",\"timeline\": \"1 hour\",\"priority\": \"\",\"sortby\": \"Component Name\",\"showAcknowledgements\": \"\"}"

Figure 2 shows an example command to retrieve the history of alarms raised in the target environment using cURL.

Figure 2 : An example command to retrieve history of alarms using cURL

Figure 2 shows a sample history of alarms retrieved from the target environment using cURL.

Figure 3 : A sample history of alarms retrieved from the target environment using cURL