There's two different approaches to tackle this problem:
-
You write a wrapper program that launches the to-be-monitored program and detects if the latter crashes.
- Have a separate application which periodically pings the to-be-monitored program. In the Unix world, there are readily available applications like
nagios, specializing in this kind of thing. Comes with the benefit that you can draw nice "uptime graphs" to show to management.
Implementation details are different for different services. A web application can be monitored by running HTTP requests, other applications can be "ping"ed on a port or checked via SNMP.