I am building an Erlang/OTP system which consists of a MochiWeb web server, some custom Erlang/OTP applications and a few non-native components, which are the following:
- a CouchDB database to store both the state of the MochiWeb web server and the persistent data (users, accounts, etc.)
- a legacy PostgreSQL database to store some other entities (orders, accounts, etc; client's requrement: can not be migrated to CouchDB, the data should be used as is);
- an Asterisk server to provide phone notifications to the users of the system.
I would like to achieve a high level of uptime and availability and thus I would like to know what is the best way to monitor those non-Erlang/OTP elements of the system. Basically, I would like to have each element of the system to be supervised, monitored and restarted if needed. It is easy achieveable for Erlang/OTP applications, but I don't know how to do that with non-Erlang components.
Should I wrap them as Erlang/OTP applications and include into the OTP supervision tree?
Or should I use some third-party software tools to monitor and supervise those non-Erlang/OTP components of the Erlang/OTP system?
What is the best known practice to do that?