SNMP

SNMP Check Disk

Description:

Yet another, but carefully crafted, plugin to check disk and memory usage on hosts via SNMP

Current Version

Last Release Date

June 23, 2009

Compatible With


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
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.
Reviews (6) Add a Review
Commands.cfg File
by mac1959, February 28, 2021
What do I put in the commands.cfg to accommodate for the use of the command in the service definition?
Helpful? Yes  No 
Works excellent!
by ffuchs, July 31, 2016
Works excellent! Thanks a lot!
Helpful? Yes  No 
Worked Perfectly
by nishith, February 29, 2016
Worked Perfectly.. Single plugin for Linux "/" swap, "/home" and "/tmp" partition monitoring.
Helpful? Yes  No 
Perfect
by feisar, March 31, 2014
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
Helpful? Yes  No 
Performance Data
by joenazz, May 31, 2011
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};
Helpful? Yes  No 
Great plugin
by chewtoy, April 30, 2011
This one works very well! Nicely written too.
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.7 (7)
Favorites
2
Views
191,546