- Monitor it via nginx that proxies the /status path
- Monitor php-fpm directly from command line
The first option was the easiest, but what if nginx went down and couldn't proxy the /status path, and what if php-fpm was on a different server? That's where option 2 came in. So I've started to google around and found this awesome command line tool called cgi-fcgi. (Can be installed via yum, # yum install fcgi)
After a afternoon of testing I've written a script that checks the status of php-fpm directly. This is still a initial version of the script. I will at a later date update the script to be more granular with warnings, e.g. worker levels, etc. Depending if it needs to be monitored. If you need that, then let me know.
Script location: check_fcgi.sh