88
To modify the custom health check:
URL for Custom Service Check:
Sometimes the WebMux built-in server health check is not enough for special needs. When an
ASP/JSP server’s output depends on the database server and the database server connection
is down, one might want to reduce the incoming traffic to the server, suspend new traffic to the
server, or totally redirect incoming traffic to a different server. To accomplish that, the WebMux
allows a farm set up using “custom defined service.” It will then call the CGI’s URL on the
server defined in this field. This will involve a custom developed CGI code by your software
developer on your server and place it on the path. Upon success the page should return HTTP
response code 200 and a plain text page beginning with one of the allowed responses. The
URL is truncated to 255 bytes (to be a string of at most 256 bytes with a terminating null). The
response from the server must fit in 4k, including all non-display tag and headers etc. This
custom CGI code must complete within 15 seconds or the server is considered dead. The
custom defined service also allows for CGI code responses that allow the server to change its
own weight and announce such change to a remote syslog daemon.
✍
Sample Custom CGI Code
The custom cgi-bin checking program may be written in Java, VB, C, or Perl, for
example, or it may be a WB or shell script. Here is a sample script written for the
Linux® shell -BASH- which sees if an SSH daemon is running as its check criterion.
#!/bin/bash
echo “Content-type: text/plain”
echo # blank line
if ps -C sshd &>/dev/null ; then
echo “OK” # response from server goes here, see list below.
echo “SSH service available”