How to health check the EPAgent HTTP RESTful interface port
search cancel

How to health check the EPAgent HTTP RESTful interface port

book

Article ID: 115946

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) INTROSCOPE

Issue/Introduction

It is useful to be able to test the health of the EPAgent HTTP RESTful interface port after enabling it in the IntroscopeEPAgent.properties file using property:
introscope.epagent.config.httpServerPort 

Environment

APM 9.7, 10.x

Resolution

For example EPAgent using HTTP port 9080 (introscope.epagent.config.httpServerPort=9080

1. Test http://EPAGENT_HOST:9080/apm/metricFeed from a browser e.g. Chrome:
If the EPAgent HTTP port is down or not accessible the result will be as follows:
This site can’t be reached 
willy03-i2438 refused to connect. 
Search Google for willy03 2438 9080 apm metric Feed 
ERR_CONNECTION_REFUSED


If the EPAgent HTTP port is up and accessible the result will be as follows (NOTE: only POST is supported): 
HTTP ERROR: 405 
Problem accessing /apm/metricFeed. Reason:

HTTP method GET is not supported by this URL

------- 
Powered by Jetty:// 



 2. Similar checks can be done with curl installed on Linux or on Windows (On Windows curl can be installed via Mingw-64 from https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer)
a. Using basic curl command with -I option for HEAD only:
C:\Program Files\Git\mingw64\bin>curl -I http://EPAGENT_HOST:9080/apm/metricFeed 
HTTP/1.1 405 HTTP method GET is not supported by this URL 
Cache-Control: must-revalidate,no-cache,no-store 
Content-Type: text/html;charset=ISO-8859-1 
Content-Length: 1351


b. Using curl command with POST and a valid payload: 
C:\Program Files\Git\mingw64\bin>curl -k -X POST http://EPAGENT_HOST:9080/apm/metricFeed -H "Content-Type:application/json; charset=UTF-8" -d "{\"metrics\":[{\"type\":\"IntCounter\", \"name\":\"Time (µs)\", \"value\":"12"}]}"
{"validCount":1}


NOTE: Using the common port 8080 for the property introscope.epagent.config.httpServerPort will cause a conflict problem if it is already being used by another Web Server or Application Server. In particular when installing EPAgent on the same server as the APM Enterprise Manager running WebView on default port 8080 this type of error will be seen because the EPAgent jetty server fails to start and the request is going to the WebView jetty server:
HTTP ERROR 404 
Problem accessing /apm/metricFeed. Reason: 
NOT_FOUND 
--------- 
Powered by jetty:// 

Additional Information

1. Enable the EPAgent Plug-ins RESTful Interface

2. Standalone EPAgent Properties