aboutsummaryrefslogtreecommitdiff
path: root/contrib/check_inodes.pl
diff options
context:
space:
mode:
authorGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2013-09-02 13:16:24 +0200
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2013-09-02 13:16:24 +0200
commitb15adb7762b6caaecaa83637abfcf5fdb4802092 (patch)
tree64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/check_inodes.pl
parentc4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff)
downloadmonitoring-plugins-b15adb7762b6caaecaa83637abfcf5fdb4802092.tar.gz
Remove "contrib" plugins
These days, sites such as "Nagios Exchange" are a much better place for publishing plugins not maintained by the Plugins Development Team.
Diffstat (limited to 'contrib/check_inodes.pl')
-rwxr-xr-xcontrib/check_inodes.pl69
1 files changed, 0 insertions, 69 deletions
diff --git a/contrib/check_inodes.pl b/contrib/check_inodes.pl
deleted file mode 100755
index 5767878f..00000000
--- a/contrib/check_inodes.pl
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/perl
-##############################################################################
-# This plugin uses df to gather filesystem statistics and check the percent #
-# used of inodes. I've put a switch in here since i've got both aix and #
-# linux systems...adjust for your syntax's results. #
-# Note: the percentages passed in MUST NOT have % after them #
-# No warranty is either implied, nor expressed herein. #
-# #
-##############################################################################
-
-$filesystem = $ARGV[0];
-$warnpercent = $ARGV[1];
-$critpercent = $ARGV[2];
-
-#------Find out what kind of syntax to expect
-$systype=`uname`;
-chomp($systype);
-
-#------Make sure we got called with the right number of arguments
-#------you could also put a check in here to make sure critical level is
-#------greater than warning...but what the heck.
-die "Usage: check_inodes filesystem warnpercent critpercent" unless @ARGV;
-
-if ($#ARGV < 2) {
- die "Usage: check_inodes filesystem warnpercent critpercent";
-}#end if
-
-#------This gets the data from the df command
-$inputline = `df -i $filesystem|grep -v "Filesystem"`;
-
-#------replaces all spaces with a single :, that way we can use split
-$inputline =~ y/ /:/s;
-
-#------different oses give back different sets of columns from the df -i
-#------(at least mine do). This way I can use this plugin on all my hosts
-#------if neither of these work, add your own in, or if you've got one that
-#------just flat out reports something different...well...perl is your friend.
-SWITCH: {
- if ($systype eq "Linux") {
- ($fs,$inodes,$iused,$ifree,$ipercent,$mntpt) = split(/:/,$inputline);
- last SWITCH;
- }#end if
- if ($systype eq "AIX") {
- ($fs,$blks,$free,$percentused,$iused,$ipercent,$mntpt) = split(/:/,$inputline);
- last SWITCH;
- }#end if
-}#end switch
-
-#------First we check for critical, since that is, by definition and convention
-#------going to exceed the warning threshold
-$ipercent =~ y/%//ds;
-
-if ($ipercent > $critpercent) {
- print "CRITICAL: $filesystem inode use exceeds critical threshold $critpercent ($ipercent)";
- exit 1;
-}# end if
-
-#------Next we check the warning threshold
-if ($ipercent > $warnpercent) {
- print "WARNING: $filesystem inode use exceeds warning threshold $warnpercent ($ipercent)";
- exit 2;
-}# end if
-
-
-#------thanks to the magic of procedural programming, we figure if we got here,
-#------everything MUST be fine.
-print "$filesystem inode use within limits ($ipercent)";
-exit 0;
-