Whenever you are running servers behind load balancers you need to perform health checks for marking servers up and down. If you are lucky then those health checks are built into the application code itself but more often than not you need to hack something together on top of existing legacy application code. In those instances xinetd and a simple script can do the trick.
A recent example of such a hack was that we needed to monitor pgpool2 instances behind a load balancer. So I hacked together this script with some help and it performed the job admirably
The other piece is the actual xinetd service configuration and that’s also pretty simple