Monday, May 27, 2013

nagios:: check_fcgi script

Ok, so we have deployed nginx/php-fpm setup to our test environment. So it got me thinking of how to monitor the php-fpm service via NRPE nagios. My initial findings where,

  1. Monitor it via nginx that proxies the /status path
  2. 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:

nagios:: check status of virtual raid disks

The importance of checking your raid proactively can't be stressed. Getting errors on your physical Dell Raid volumes can mean life or death depending on how critical the volume is. I've created a check script that works with NRPE and uses Dell's omreport command line tool to gather the virtual drives per each controller and then displays their statuses. 

The file can be found on my public git repository,

A word of warning, make sure that you use the latest omreport from dell, as the older versions output differs from the later ones.


Initial Post

I'm going to be posting more of my linux knowledge to this blogspot. Posts will vary in difficulty but will hopefully be useful for some people. If you find something that you like, remember to link back and post/plus1/facebook the link. 

Have fun, now the time consuming migration from my wordpress to this blog will now start.