can use the simple but powerful xinetd on your Linux server to monitor
almost anything on the server. Since xinetd just holds open a port and
waits for a connection, you can tell it to run a script and return the
output directly to the network stream.
read more here