New module: Nagios monitoring for your Drupal sites

Published Tue, 2009/02/03 - 13:30, Updated Wed, 2009/02/04 - 12:19

2bits.com has released the Nagios monitoring module that integrates your Drupal site (or hundreds of sites!) into with the Nagios monitoring application.

The module reports to Nagios that the site is up and running normally, including:

  • PHP is parsing scripts and modules correctly (in case PHP gets disabled for some reason)
  • The database is accessible from Drupal
  • Whether there are configuration issues with the site, such as:
    • pending Drupal version update
    • pending Drupal module updates
    • unwritable 'files' directory
    • Pending updates to the database schema
    • Cron not running for a defined period.
    • Anything else reported in the Administer -> Reports -> Status report (requirements)

If you already use Nagios in your organization to monitor your
infrastructure, then this module will be useful for you. If you only
run one or two Drupal sites, Nagios may be overkill for this task.

The module is currently available only for Drupal 6.x.

Why not push instead of pull?

Hi,

I'm an experienced sysadmin, very familiar with Nagios, but just getting my feet wet with Drupal.

First, nice work! This module looks like it does a great job at presenting data to Nagios for monitoring.

Two design questions:

1) Using a shell script is pretty inefficient. You can use the supplied check_http plugin to do a lot of what you want. You can even have it use https so that the data isn't being sent in the clear.

2) Did you look at using NSCA to have drupal push data back to Nagios? Often times, Nagios servers are overloaded with too many tasks. One of the first things you can do to help the situation is to have the client push its data to Nagios. NSCA supports SSL out of the box, so there's no worry there. You could setup a drupal cron entry to send the data off to Nagios.

Thanks for the module! None of this is criticism, just a few curious questions ;-)

Thanks,

Justin

Answers

1.a) Why shell? Simply because it does not require any compilation or building. A C program would provide complexity for deployment. Running a shell script every few minutes has negligible overhead.

1.b) Why not use check_http? Because I have to parse the output anyway, so it offers no advantage over wget in this case.

2) Why not NSCA to push Drupal data to Nagios? Again, it is about complexity of deployment and dependencies. If the user wants to monitor Windows and Linux and BSD servers running Drupal, all they need is a module on Drupal. Requiring an agent on each server just complicates matters more.

A valuable addition for sys admins

Nagios is a great tool for monitoring servers on the network. Unfortunately, application monitors are rare, and I usually end up hacking one together. I'm thrilled to see a new module that makes the sys admin's job easier... without the hacking.

Great work!

I am convinced that Nagios could be a great component in a developer setup with someone who has more than just a couple of sites, in order to monitor their state in a straightforward (and free!) manner.

I had started working on that (see "Drupal Development Server..." at http://awebfactory.com.ar/node/345 ), including instructions on how to install Nagios on a Ubuntu server ( http://awebfactory.com.ar/node/345#installnagios ), and how to add host services (see http://awebfactory.com.ar/node/345#firststepsnagios ).

Will definitely look into your module and comment. Thanks for the great work!

Victor Kane
http://awebfactory.com.ar

Nice!

We can certainly use this! We already use nagios with some monitoring but this could make our reports much more useful :-)

Thanks!

Excellent Contribution!

That's an excellent contribution to the Drupal world. :-) Thanks!

Very cool!

I took a look at Nagios a little while ago, but the lack of Drupal specific features definitely made it less appealing to deal with bothering with long-term. Might have to rethink that now. Good work, and thanks for sharing.

Great work!

Just what I have been looking/waiting for. Thanx!

Is your Drupal or WordPress site slow?
Is it suffering from server resources shortages?
Is it experiencing outages?
Contact us for Drupal and WordPress Performance Optimization and Tuning Consulting