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 !!!