Ping API


This API will be used to ping the given server or the server corresponding to the given ping monitor's resource ID. The ping command will be executed and the result will be passed as response of the request.

Syntax

API for XML Response:

https://[HOST]:[PORT]/AppManager/xml/Ping?apikey=[ API Key ]&resourceid=[RESOURCE ID]

API for JSON Response:

https://[HOST]:[PORT]/AppManager/json/Ping?apikey=[ API Key ]&host=[HOSTNAME]

Supported HTTP methods: GET

Allowed roles: Administrator, Operator, User

Request Parameters

Field Description
resourceid This value specifies the resourceid of the monitor, So that we can ping host corresponding to monitor.
host This is the host of any server which can be passed as parameter to ping from the Applications Manager server.

Response Parameters

Field Description
Output The output obtained from ping operation.
Host Hostname of the server for which the ping operation is performed.
IPAddress IP Address of the server for which the ping operation is performed.

Sample Request

XML Input:

https://apm-prod-server:8443/AppManager/xml/Ping?apikey=apikey=aaaaaabbbbbbccccccddddddeeeeee&resourceid='10000157'

XML Response:

<AppManager-response uri="/AppManager/xml/Ping">
<result>
<response response-code="4000">
<PingResult Output="Pinging apm-prod-server (127.0.0.1) with 32 bytes of data:
Reply from apm-prod-server (127.0.0.1): bytes=32 time<1ms TTL=128
Ping statistics for apm-prod-server (127.0.0.1):
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
" Host="apm-prod-server" IPAddress="127.0.0.1"/>
</response>
</result>
</AppManager-response>

JSON Input:

https://apm-prod-server:8443/AppManager/json/Ping?apikey=aaaaaabbbbbbccccccddddddeeeeee&host=apm-prod-server

JSON Response:

{"response-code":"4000",
"response": {
"uri":"/AppManager/json/Ping",
"result":[
{
"Output":"Pinging apm-prod-server (127.0.0.1) with 32 bytes of data:
Reply from apm-prod-server (127.0.0.1): time<1ms
Ping statistics for apm-prod-server (127.0.0.1):
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
","Host":"apm-prod-server",
"IPAddress":"127.0.0.1"}
],
}
}