check_oes_linux_nss_volume_usage
This check programs allows you to check the volume usage of nss volumes running on OES linux systems and monitor several other parameters. I used the nss command file to query not only volume usage information, it also provides the number of files and some purgeable and compression information. Maybe not all information is interesting to be monitored, but just having it to generate additional graphs is very helpful.
As this is a perl based program it needs to have a few perl modules installed. Beside the perl packages already installed for several OES componentes I needed to install perl-XML-RegExp and perl-XML-DOM.
This check program was tested with OES 2 SP1/SP2 i586 and OES 2 SP2 x86-64.
Here is a sample output of the check program:
check\_oesnss\_vol.pl -V DATA1 -w 10000 -c 5000 -M
or
check\_oesnss\_vol.pl -V DATA1 -w 10G -c 5G -M
check\_oesnss\_vol.pl -V DATA1 -w 20% -c 10%
produces
CRITICAL - 0% used, NSS Vol: DATA1, Pool: POOL1, Size: 554 MB, Used: 1 MB, Free: 553 MB, Files: 13, Purgeable: 0 MB, addComp: 0 MB|VolumeSize=579862528B UsedSpaceTotal=569344B;10475520000;5237760000 FreeSpaceTotal=579293184B NumberOfFiles=13 PurgeableSpace=16384B WonByCompression=0B UsedSpacePercent=0% FreeSpacePercent=100%
Please take in mind that depending on your nagios configuration you must run this check program via sudo because the normal nagios user might not have rights to access the nss management file in /_admin.
If you want to see any enhancements, feel free to contact me.
The email address is in the source code available.
Rainer Brunold
Usage
This check program queries several nss volume statistics and compare the the free space against the warning and critical levels. It provides automatically performance data and is highly exetnsible to all parameters that can be queried via the nss management file. As that nss management file ".$nssmgmtfile." is not writeable for all user, you might need to add a sudo entry for the nagios user to allow the access to that file.
You can define with the -M, -G and -k options in which format you would like to have the service results listed, the performance data itself is allways reported in bytes.
Usage: check_oesnss_vol.pl -V -w -c [-d] [-h] [-v] [-M] [-G] [-k]
Parameters:
-c ... critical level for the free space in [k|M|G|%]
if no extension is given I assume it is in MB
-d ... print debug information
-h ... print help / usage
-k ... results are shown in kB
-G ... results are shown in GB
-M ... results are shown in MB
-v ... version
-V ... define the NSS volume you want to monitor
-w ... warning level for the free space in [k|M|G|%]
if no extension is given I assume it is in MB
Samples:
check_oesnss_vol.pl -V DATAHK07 -w 10000 -c 5000 -M
OK: NSS Vol: DATAHK07, Pool: DATAHK07, Size: 41000 MB, Used: 3423 MB, Free: 37577 MB, Files: 341, Purgeable: 3399 MB, addComp: 24 MB|DATAHK07=42949672960;3585662976;39364009984;341;3560329216;24940544;8;92
check_oesnss_vol.pl -V DATA -w 20% -c 10%
OK - 0% used, NSS Vol: DATA, Pool: POOL1, Size: 21472739328 Byte, Used: 692224 Byte, Free: 21472047104 Byte, Files: 39, Purgeable: 24576 Byte, addComp: 12288 Byte|DATA=21472739328;692224;21472047104;39;24576;12288;0;100
The performance data has the following order:
- volume name
- volume size in byte
- used space in byte
- free space in byte
- number of files in this volume
- purgable space in bytes
- won space by compression in byte
- percent used of this volume
- percent free of this volume
If you want to see any enhancements, feel free to contact me via email. The email is in the header of the file.
Rainer Brunold, 17.10.2009
Changelog
**
1.0 - initial version
1.1 - error in free space calculation was fixed, added volume usage in percent to service output
1.2 - added value type k,M,G or % for the warning and critical level
1.3 - modified the performance output to follow the official plugin rules
1.4 - modified the performance output to follow the official plugin rules from http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN201