joinVM’s Blog

May 6, 2009

Nagios Check Script for VMFS Volumes

Filed under: Nagios, VMware — joinvm @ 9:09 am

Using this Script, you can check your vmfs-volumes (LUN, NFS, iSCSI, Local ESX Discs) for remaining free space using Nagios.

You have to do the following steps to use this script:

1. copy check_mvol.sh to your Nagios installation-directory (f.e. /usr/local/nagios/libexec/check_mvol.sh)

2. chmod the file for execution (chmod +x)

3. edit your nrpe.cfg while adding the following line:

“command[check_mvol]=sudo /usr/local/nagios/libexec/check_mvol.sh 50 10″

where “50” means: warning on less then 50 GB available space on one of your vmfs-volumes (exit 1)

and “10” means: critical on less then 10 GB available space on one of your vmfs-Volumes (exit 2)

Nagios will tell you, which volumes have an available space problem in your Nagios overview

4. Add the following line to your sudoers-file to help your nagios user-account :)

“nagiosĀ  ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_mvol.sh”

Please be aware, that the actual version is not able to:

a, check only specific volumes

b, check on % of space instead of sizes in GB

I’ll try to bring up another version in the future with extended features.

The actual version works fine on ESX 3.x.

Have much fun using it !!!

Chris

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: