Retrieving Historical Data of a Measure

To figure out whether the target environment is functioning without any glitches, more often than not, administrators tend to monitor the performance of certain key measures over a period of time. Using the eG REST API, administrators are befitted in monitoring the performance of the measures over a period of time without logging into the eG console. The table below specifies the parameters that should be used to retrieve the historical data of the measures.

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

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

{

"timeline":"1 hour",

"server":"Microsoft Windows:win112:NULL",

"test":"Network",

"measure":"packet loss"

}

Example for retrieving historical data of a measure pertaining to an Oracle Database Server:

{

"timeline":"1 day",

"server":"Oracle Database Server:Oradb:1521:egora",

"test":"Oracle Sessions",

"measure":"Active Sessions"

}

Body

Default:

{

"timeline":"Timeline for retrieving the measure data (in hours/days/weeks)",

"server":"Component Type:Component name:Port/Null",

"test":"Test name",

"measure":"Measure name"

}

If current measures of the Oracle Database server is to be retrieved, then the Key values should be specified as follows:

{

"timeline":"Timeline for retrieving the measure data (in hours/days/weeks)",

"server":"Component Type:Component name:Port:SID",

"test":"Test name",

"measure":"Measure name"

}

 

Success Response
Type Code Example Response

JSON

200

{

"NetworkTest": [

{

"Date": "29/09/2020 05:33:13",

"Value": "0.0"

},

{

"Date": "29/09/2020 05:38:40",

"Value": "0.0"

},

.

.

.

]

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

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

JSON

500 Server Error

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

Figure 1 : Retrieving historical data of a measure using Postman REST Client

Retrieving Historical Data of a Measure using cURL

To retrieve the historical data of a measure using cURL, the command should be specified in the following format:

curl -location -request POST "http://<eG Manager IP:Port>/api/eg/analytics/getHistoricalData" -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 "{\"timeline\":\"Timeline for retrieving the measure data (in hours/days/weeks)\",\"server\":\"Component Type:Component name:Port\",\"test\":\"Test name\",\"measure\":\"Measure name\"}"

Figure 2 shows an example of retrieving the current measures of a component using cURL.

Figure 2 : Retrieving historical data of a measure using cURL