Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
Yet another, but carefully crafted, plugin to check disk and memory usage on hosts via SNMP
Current Version
Last Release Date
June 23, 2009
Owner
Nagios Exchange
Compatible With
General Description and Usage
Plugin Source
This plugin is written in perl, and uses Net::SNMP to access the hrStorage OID on remote hosts to get filesystem and memory usage. I started out with other disk status plugins, and all the ones I tried appeared either too rigid (hard coded thresholds, etc.), or not tightly coded enough to work with Nagios embedded perl. This plugin is very configurable, and works with the Nagios embedded perl quite well. This plugin also allows warning and critical thresholds as either a percentage or actual available space. This is important for larger filesystems that can be 96% full, with 20GB free. With an actual space threshold, you can define a warning at 1GB free, critical at 512MB, instead of calculating the nearest percentage. Another nice feature for those having to monitor windows hosts, is the ability to leverage the built-in SNMP service with windows. This plugin allows you to specify a windows drive letter, and it will do the right thing automatically for you. No mucking about with what SNMP device index matches up with the drive letter, which makes monitoring configuration much easier. Finally, there are several description abbreviations built-in that allow you to specify "virt" for "Virtual Memory", "real" for "Real Memory" and the like. No having to futz around with trying to escape quotes inside of nagios config files.
What do I put in the commands.cfg to accommodate for the use of the command in the service definition?
Works excellent! Thanks a lot!
Worked Perfectly.. Single plugin for Linux "/" swap, "/home" and "/tmp" partition monitoring.
Needed an simple way to monitor Windows Server 2008 R2 servers from Nagios. I Did have to make one change to the plugin for CentOS however. Top of the file should read: use lib "/usr/lib64/nagios/plugins"; or the following error occurs: Can't locate utils.pm in @INC
Added performance data output. Maybe you will alter the script? --- check_disk_snmp.pl_2011-06-01_091729-536735145 2011-05-30 17:00:49.195836862 +0200 +++ check_disk_snmp.pl 2011-06-01 10:33:59.627838690 +0200 @@ -40,7 +40,10 @@ my $devUsed = q{}; ## - used oid my $perc = 0; ## - device percent used my $free = 0; ## - device free space +my $used = 0; ## - device used space my $size = 0; ## - device size +my $size_warn = 0; ## - device warning size +my $size_crit = 0; ## - device critical size my %unit_t = ( ## - units table 'KB' => 1 {$devSize}) * 100); $size = sprintf("%0.2f", $resp->{$devSize} / $unit_sz); +$size_warn = sprintf("%0.2f", ($resp->{$devSize} / 100) * substr($warn,0,-1) / $unit_sz); +$size_crit = sprintf("%0.2f", ($resp->{$devSize} / 100) * substr($crit,0,-1) / $unit_sz); +$used = sprintf("%0.2f", $resp->{$devUsed} / $unit_sz); $free = sprintf("%0.2f", ($resp->{$devSize} - $resp->{$devUsed}) / $unit_sz ); @@ -334,8 +340,9 @@ if ($free >= 100) {$free = commify(int($free))} if ($size >= 100) {$size = commify(int($size))} -print "SNMP $state - ", - "$resp->{$devDesc} at ${perc}% with $free of $size $unit_desc freen"; +print "DISK $state - ", + "$resp->{$devDesc} at ${perc}% with $free of $size $unit_desc free", + " | disk_usage=$used$unit_desc;$size_warn;$size_crit;0;$sizen"; exit $ERRORS{$state};
This one works very well! Nicely written too.
You must be logged in to submit a review.
To:
From: