I am building a system with dependencies such as Apache, Postgresql and mod_wsgi. As part of my deployment process, I would like to write a health check script that tries to determine if the server environment meets various assumptions, the most basic of which is the installation of dependencies.
Checks I reviewed:
- Check if the service is responding, for example. make an HTTP request, connect to the database, etc.
- Check how the service works, for example. perhaps grepping
ps ax ? (It seems unreliable) - Make sure the package is installed, for example. through the dpkg request.
They obviously go in decreasing order of specificity, I hope that if one test fails, I can find out why by doing a more specific test.
But where to stay? How many levels of specificity should I check? Are there any best practices for this kind of thing?
Thanks!
source share