Healthcheckservlet

Configuring the EJBCA Health Check Servlet.

In EJBCA exists a health check servlet that can be used for clustering and remote health monitoring.

The servlet is located in the URL: http://localhost:8080/ejbca/publicweb/healthcheck/ejbcahealth
and is configured in the file src/publicweb/healthcheck/WEB-INF/web.xml.

The following parameters may be set:

Required parameters:

  • HealthCheckClassPath, default 'org.ejbca.ui.web.pub.cluster.EJBCAHealthCheck' - Class performing the healthcheck.
  • HealthResponseClassPath, default 'org.ejbca.ui.web.pub.cluster.TextResponse' - Class creating the response to the loadbalancer or monitor software.

Optional parameters:

Configure this in ejbca.properties.

  • AuthorizedIPs, default: '127.0.0.1' - Specifies which remote IPs that may call this healthcheck servlet. Use ';' between multiple IPs.

EJBCAHealthCheck specific init parameters:

Configure this in ejbca.properties.

  • MinimumFreeMemory, default: '1' - The number of Mb of memory that must be free.
  • checkDBString, default: 'select 1' - Parameter indicating the string that should be used to do a minimal check that the database is working.
  • CheckPublishers, default: 'false' - Defines if test connections agains all configured publisers should be performed.

TextResponse specific init parameters:

  • OKMessage, default: 'ALLOK', the text string sent as text/plain when everything seems fine.
  • SendServerError, default 'true', indicates if a Server Error 500 should be returned with an error message.
  • CustomErrorMessage, default: commented out, if a static error message should sent in the reply instead of a dynamic one.

Error messages of the default EJBCAHealthCheck.
If an error is detected one or several of the following error messages is reported.

"Error Virtual Memory is about to run out, currently free memory : <Freememory>"
The JVM is about to run out of memory.

"Error creating connection to EJBCA Database."
JDBC Connection to the database failed, this might occur if DB craches or network
is down.

"Error CA Token is disconnected <CAName>"
This is a sign of hardware problems with one or several of the hard ca tokens
in the node.

"Cannot connect to publisher <PublisherName>"
This is reported when a testconnection to one of the publishers failed.

Customizing the health check servlet.

The servlet is divided into two parts, one is the actual health checker
and should implement the interface org.ejbca.ui.web.pub.IHealthCheck.
The other one is the responder, in charge of creating a reply to the requestor
and should implement the IHealthResponse interface. In this way may a
checker be used with different loadbalancers expecting different replies.

If you want to customize health check servlet you should specify
your own classes in the parameters HealthCheckClassPath and/or
HealthResponseClassPath.

page_revision: 0, last_edited: 1206020108|%e %b %Y, %H:%M %Z (%O ago)
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License