summaryrefslogtreecommitdiffstats
path: root/hosts/wbq0-armhf-rb/usr/local/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/wbq0-armhf-rb/usr/local/sbin')
-rwxr-xr-xhosts/wbq0-armhf-rb/usr/local/sbin/nagios-check-libs12
1 files changed, 9 insertions, 3 deletions
diff --git a/hosts/wbq0-armhf-rb/usr/local/sbin/nagios-check-libs b/hosts/wbq0-armhf-rb/usr/local/sbin/nagios-check-libs
index 977605d0..77b37805 100755
--- a/hosts/wbq0-armhf-rb/usr/local/sbin/nagios-check-libs
+++ b/hosts/wbq0-armhf-rb/usr/local/sbin/nagios-check-libs
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2005, 2006, 2007, 2008, 2012 Peter Palfrader <peter@palfrader.org>
+# Copyright (C) 2005, 2006, 2007, 2008, 2012, 2015 Peter Palfrader <peter@palfrader.org>
# 2012 Uli Martens <uli@youam.net>
#
# Permission is hereby granted, free of charge, to any person obtaining
@@ -30,7 +30,7 @@ $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $LSOF = '/usr/bin/lsof -F0';
-my $VERSION = '0.2012042101';
+my $VERSION = '0.2015012901';
# nagios exit codes
my $OK = 0;
@@ -53,6 +53,7 @@ if (!GetOptions (
'--version' => \$params->{'version'},
'--quiet' => \$params->{'quiet'},
'--verbose' => \$params->{'verbose'},
+ '-v' => \$params->{'verbose'},
'--config=s' => \$params->{'config'},
)) {
dief ("$PROGRAM_NAME: Usage: $PROGRAM_NAME [--help|--version] [--verbose] [--quiet] [--config=<CONFIGFILE>]\n");
@@ -169,7 +170,12 @@ LINE: for my $line (@lsof) {
my $fd = $fields{f};
my $inode = $fields{i};
my $path = $fields{n};
- if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $fd eq 'DEL') {
+ if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $path =~ m#/\.nfs# || $fd eq 'DEL') {
+ my $deleted_in_path = ($path =~ m/\(deleted\)/ || $path =~ m/\.nfs/);
+ next if ($deleted_in_path && $fd =~ /^[0-9]*$/); # Ignore deleted files that are open via normal file handles.
+ next if ($deleted_in_path && $fd eq 'cwd'); # Ignore deleted directories that we happen to be in.
+
+ $path =~ s/^\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string
for my $i (@{$config->{'ignorelist'}}) {
my $ignore = eval($i);
next LINE if $ignore;