File nagios-plugins-1.4.14-check_inodes.patch of Package nagios-plugins
http://osdir.com/ml/network.nagios.devel/2005-12/msg00015.html
--- contrib/check_inodes.pl 2008-01-05 16:42:26.000000000 +0100
+++ contrib/check_inodes.pl.oden 2008-01-05 17:45:28.000000000 +0100
@@ -8,12 +8,12 @@
# #
##############################################################################
-$filesystem = $ARGV[0];
-$warnpercent = $ARGV[1];
-$critpercent = $ARGV[2];
+my $filesystem = $ARGV[0];
+my $warnpercent = $ARGV[1];
+my $critpercent = $ARGV[2];
#------Find out what kind of syntax to expect
-$systype=`uname`;
+my $systype=`uname`;
chomp($systype);
#------Make sure we got called with the right number of arguments
@@ -26,7 +26,7 @@
}#end if
#------This gets the data from the df command
-$inputline = `df -i $filesystem|grep -v "Filesystem"`;
+my $inputline = `df -i $filesystem|grep -v "Filesystem"`;
#------replaces all spaces with a single :, that way we can use split
$inputline =~ y/ /:/s;
@@ -35,13 +35,14 @@
#------(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.
+my $ipercent;
SWITCH: {
if ($systype eq "Linux") {
- ($fs,$inodes,$iused,$ifree,$ipercent,$mntpt) = split(/:/,$inputline);
+ $ipercent = (split(/:/,$inputline))[4];
last SWITCH;
}#end if
if ($systype eq "AIX") {
- ($fs,$blks,$free,$percentused,$iused,$ipercent,$mntpt) = split(/:/,$inputline);
+ $ipercent = (split(/:/,$inputline))[5];
last SWITCH;
}#end if
}#end switch