New Feature: auto restart service monitoring

Thursday, March 20th, 2008 3:58PM EDT

We’re always working on new ways to ensure services (like Apache and PHP) not only accept HTTP requests but also function properly. Our goal has always been to be a proactive managed service provider and resolve issues before anyone is even aware of an issue occurred.

Recently we had a customer’s PHP fail (core dump) every few days. While Apache was still active, PHP failed and in the process failed to generate any PHP pages. Initially we were just monitoring Apache to ensure it returned a valid result. Obviously that wasn’t enough and we created a PHP page and regexed it to ensure it returned a valid result. Once it failed we were alerted to PHP was no longer working. This was good but wasn’t enough. We’ve wanted to proactively resolve the issue instead of us reacting and manually restarting Apache each time PHP failed. We thought it was better to have Nagios (part of our monitoring system) automatically restart apache when PHP failed to return a valid test result. Ideally we want to get to the root reason why PHP was failing, but that isn’t always viable nor know if PHP has other critical bugs that will cause PHP to cease functioning in the future.

Nagios is a very powerful and flexible monitoring tool. We’ve used it for many years, since it was called NetSaint, and have added many custom features and plug-ins to help monitor our infrastructure. Our control panel of choice (DirectAdmin), while has a rudimentary service check to see if Apache is running, doesn’t check to see if the HTTP port is available and outputs a valid result. This is a big difference and this is where Nagios really shines. The option we use under Nagios is called event handlers.

We are slowly rolling out this new feature to all managed servers, managed VPSes, reseller servers and shared hosting servers. For now we are adding this to restart the Apache and ClamAV service but will add other services in the future. We’ll be implementing more event handlers in the future to handle other services and perform other actions. The possibilities are limitless. If needed, we can also monitor services at the application level (i.e. is your shopping cart working properly), if you have any special monitoring requests, just ask!

Comments are closed.

Categories

Blog Subscription

Get updates via Email