. . .

Health checks

Modules can implement a health check method which returns an integer value, representing the health state.

By definition, -1 means no health check is implemented and 0 means "OK". All other values can be defined by the developer itself.

Implementation is done in the checkHealth method of the module main class:

...
@Override
public int checkHealth( final String appName, final String system )
{
return -1;
}
...

The method can be executed from outside using the following REST URL:

curl http(s)://<HOSTNAME>/yambas/rest/modules/<MODULENAME>/<APPNAME>/health

The response will contain the status code in the response body.

The request has to be executed at least with an app member having the READ_HEALTH role.

The health status is also shown in the dashboard menu:

images/download/attachments/61479036/icon.png

On the left side of each module is a small vertical bar bar displayed. This bar could be green (code: 0) or red (specific error code). When there is no health check implemented, the bar isn't shown.

You could also hover this bar to view a tooltip:

images/download/attachments/61479036/icon_hover.png

Furthermore, you could use the context menu of the module to check the health status again.

images/download/thumbnails/61479036/context_menu.png

With clicking the "Health check" button open a dialog opens, that shows the result and explains it.

images/download/thumbnails/61479036/dialog.png