The Cult of Gary

06 Feb

Monitoring 3ware cards with Zenoss

I need to monitor 3ware raid cards using Zenoss. A few google searches didn’t show anyone else doing this directly, so I put a few things together. I’m still new to Zenoss, so this may be a bit hack-ish. 

I found a Nagios plugin that was capable of checking the status of a 3ware card. It requires the tw_cli command be installed, which I already had. I tested out running the command locally, and it seems to work. I only have one array at this point, and I don’t want to force it to degrade to test the script.

I followed the Zenoss howto on using Nagios plugins. The steps were straight forward. I needed to configure my monitor to use SSH and I had to configure the zProperties of the server in question to allow for SSH logins.

I’d say that Zenoss’ support for nagios plugins isn’t that robust. The check is categorized as a performance monitor, but it’s not at all. It also doesn’t show up in the server’s page properties. The only time there is any trace of the monitor is when there is a failure. The other thing I noticed is that Zenoss doesn’t detect the difference between warnings or failures on the nagios scripts. I suppose that since I am a newbie, I could be completely wrong about this.

Monitoring does work, though. I modified the check_3ware.sh script to return failures. They show up in the events and I get emails about it. 

I created a ZenPack that has the configuration to run the nagios command. It’s pretty straight forward and doesn’t really need a ZenPack, but I figured it’s good practice.

If you want to get this working for yourself:

  1.  Make sure tw_cli is installed in the path of all the servers you want to monitor
  2. Install check_3ware.sh into /usr/bin
  3. If you don’t have a user that Zenoss can log in as, add one
  4. check_3ware.sh needs to run as root, so make sure that user has sudo access to run /usr/bin/check_3ware.sh with no password.
  5. On the Zenoss side, make sure the zProperties for zCommandUsername and zCommandPassword are set for the servers you’re monitoring.
  6. Install my 3wareArray 0.1.0 ZenPack into Zenoss
  7. Bind the 3wareRaid template to the servers you wish to monitor

You can force Zenoss to test out the server by running zencommand -d server_name -v10. You can test a failure by adding the following to the top of the check_3ware.sh on a given server:

echo "CRITICAL: arrays are broken"

exit 2

Be sure to remove it when you’re satisfied with your tests :)

3 Responses to “Monitoring 3ware cards with Zenoss”

  1. 1
    Erek Dyskant Says:

    Ah, thanks for that tip. I looked for a check_3ware nagios plugin about 3 years ago, and didn’t find one so I ended up writing my own limited one. This one looks much more robust, so I’ll work on switching over to it soon.

  2. 2
    Zenoss Blog » Zenoss Newsletter - February 2008 Says:

    […] Cult of Gary: Monitoring 3ware Cards with Zenoss […]

  3. 3
    Chet Luther Says:

    You can use the 1/2 exit codes from Nagios plugins to drive the severity of the resulting Zenoss event.

    The way it works it that if the plugin exits with a code of 1 (WARNING) Zenoss will set the severity of the event to whatever you selected for severity when you created the data source. If the plugin exits with a code of 2 (CRITICAL) Zenoss will use the next highest severity.

    So if you choose Warning as the severity in the data source, and the plugin exits with a code of 2, the event will actually have a severity of Error.

    Hope this makes sense!

Leave a Reply

© 2008 The Cult of Gary | Entries (RSS) and Comments (RSS)

GPSwordpress logo