Retrieving Infrastructure Health

Using the eG REST API, administrators can figure out the health of the Zone/Service/Segment/Component Type managed in the eG manager without logging into the eG console. The table below specifies the URL and the parameters that should be used to retrieve the health of the infrastructure.

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

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

Example to retrieve the health of a zone:

{

"filterBy":"zone",

"filterValues":"SEN-SQL.Zone"

}

Example to retrieve the health of the components of a chosen Component Type:

{

"filterBy":"ComponentType",

"filterValues":"Microsoft Windows"

}

Body

Default:

{

"filterBy":"Zone/Service/Segment/Component Type",

"filterValues":"Name of Zone/Service/Segment/Component Type"

}

 

Success Response
Type Code Content

JSON

200

{

"healthSummary": [

{

"componentName": "SQL_Cluster_10.51:1433",

"componentType": "Microsoft SQL Cluster",

"priority": "critical"

},

{

"componentName": "SQL_10.36:1433",

"componentType": "Microsoft SQL",

"priority": "critical"

},

{

"componentName": "TEZ-MSSQL-DB:1433",

"componentType": "Microsoft SQL",

"priority": "minor"

}

],

"alertSummary": [

{

"priority": "minor",

"count": 1

},

{

"priority": "critical",

"count": 2

}

],

"currentStatus": [

{

"zone": "SEN-SQL.Zone",

"priority": "critical"

}

]

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

{"code": 401,"error": "Invalid username or password"}

JSON

400 BAD REQUEST

You may receive one of the following responses:

{"code": 400,"error": " Bad Request. Header parameters : Username or Password or Manager Url is missing"} (or)

{"code": 400,"error": " Bad Request. Manager Url,Username,password is not provided"} (or)

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

{"code": 400,"error": "filterBy or filterValues is not provided"} (or)

{"code": 400,"error": "Component Type is invalid"} (or)

{"code": 400,"error": "Service name is invalid"} (or)

{"code": 400,"error": "Zone name is invalid"} (or)

{"code": 400,"error": "Segment name is invalid"}

JSON

500 Server Error

{"code": 500,"error": " Server Error. Please check /manager/logs/error_log in the installation directory for more information"}

Figure 1 : Retrieving the health of the components in a zone using Postman REST Client

Retrieving Infrastructure Health using cURL

To retrieve the health of the Zone/Service/Segment/Component Type managed in the eG manager using cURL, the command should be specified in the following format:

curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getInfraHealth" -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 "{\"filterBy\":\"Zone/Service/Segment/Component Type\",\"filterValues\":\"Name of Zone/Service/Segment/Component Type\"}

Figure 2 shows an example of retrieving the health of the components within a zone in the target environment using cURL.

Figure 2 : Retrieving the health of the components in a zone using cURL