How to check OneClick Web Server status by using HTTP GET statement?
search cancel

How to check OneClick Web Server status by using HTTP GET statement?

book

Article ID: 10270

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

If OneClick server is running in a stable state, on OneClick server there will be a stable.txt file automatically created under $SPECROOT\tomcat\webapps\spectrum directory. The content of this file is the followings:

This is an automatically generated file which indicates tomcat process is currently in stable state.  Should tomcat experience catastrophic error such as an out of memory error, the file will be automatically deleted. The file will be recreated upon tomcat restart.  Load balancer status checking which performs periodic checks on the health of a server should perform a GET on this stable file http://<host>:<port>/spectrum/stable. Failure to retrieve the file indicates either tomcat is not running or poor health of the tomcat process. 

If OneClick server is not running or poor health, this stable.txt file would not exist under $SPECROOT\tomcat\webapps\spectrum directory.



Environment

Spectrum 9.4.x; Spectrum 10.x; Spectrum 2[1-3].x

Resolution

To achieve load balancing, we can identically configure multiple OneClick web servers that are accessed through an external load balancing device.

We can configure our load balancer to check the status of each OneClick server by using the following HTTP GET statement during periodic server health checks:

http://<hostname>:<portnumber>/spectrum/stable

  • If OneClick Web Server is running stably, the result of this HTTP Get request is the content of the file which is:

This is an automatically generated file which indicates tomcat process is currently in stable state.  Should tomcat experience catastrophic error such as an out of memory error, the file will be automatically deleted. The file will be recreated upon tomcat restart.  Load balancer status checking which performs periodic checks on the health of a server should perform a GET on this stable file http://<host>:<port>/spectrum/stable. Failure to retrieve the file indicates either tomcat is not running or poor health of the tomcat process. 

  • If OneClick Web Server is not stable or running, the result of this HTTP Get request is: HTTP Status 404

Additional Information

The functionality will delete the file only if we have the following errors (in bold below) seen in the Tomcat log.  Customers can add the errors they are interested in.

<$SPECROOT>\tomcat\webapps\spectrum\WEB-INF\web.xml

 <context-param xmlns="">
    <param-name>com.ca.spectrum.tomcathealthwatcher</param-name>
    <param-value>are currently busy, waiting|
       Increase maxThreads|
       Dumping heap to|
       java.lang.OutOfMemoryError|
       GC overhead limit exceeded</param-value>
    <description>The tomcat health file is indicated by the presence of the stable file
       in the spectrum directory.  When the phrases above are found in the
       process output log, either stdout.log or catalina.out, the stable file
       is removed.  The stable file is best used for load balancers needing to
       test the health of a host serving process. Failure to retrieve this
       file indicates the process is down or health is poor.</description>
  </context-param>

This is a REST API call so does not check for authorization.  If tomcat is down the file is not deleted, we get a 404 on the get request via the browser.