Use Nagios to Monitor Linux Software RAID

I use Nagios to monitor every server in my company’s infrastructure. It’s a bit of a hassle to setup, but once you get it up and running and understand the basic concept and how to use NRPE, it becomes easy to start monitoring every aspect of every machine in your network.

There are many services for which you need to seek out monitoring scripts in order to keep an eye on them with Nagios. The software comes with numerous basic scripts, but when I wanted to keep an eye on the health of my md volumes, I had to wade through a number of scripts to find one that worked how I wanted.

Step by Step Guide

Download the check_raid script to your nagios plugins folder

cd /usr/lib64/nagios/plugins

wget https://marshallstokes.com/downloads/check_raid

In case you want to download the script another way, it’s here: https://marshallstokes.com/downloads/check_raid

Make sure the script is executable

chmod 755 check_raid

Run the script to confirm the output works (are you really using linux software raid?)

/usr/lib64/nagios/plugins/check_raid

You should see something like this:

OK: md:md0:UU md:md1:UU

Add it to your nrpe config for remote use

command[check_raid]=/usr/lib64/nagios/plugins/check_raid

Hopefully you know what to do after this step. If not, let me know in the comments section below and I’ll try to hold your hand a bit to get it working!

Print Friendly, PDF & Email

2 thoughts on “Use Nagios to Monitor Linux Software RAID”

  1. Leandro Cleto says:

    Hello Bro.

    Im trying to add this plugin to run at the nagios server and to check server software raid (its not to remote check). Could you give me a hand?

    1. Marshall Stokes says:

      Hi Leandro,

      You can use the check_raid script as a local check just like any nagios check. Put the file in your plugins folder and create a new service check definition and it should just work!

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax