summaryrefslogtreecommitdiff
path: root/nagios-checks/nagios-check-libs
diff options
context:
space:
mode:
Diffstat (limited to 'nagios-checks/nagios-check-libs')
-rwxr-xr-xnagios-checks/nagios-check-libs5
1 files changed, 5 insertions, 0 deletions
diff --git a/nagios-checks/nagios-check-libs b/nagios-checks/nagios-check-libs
index 89d7f3a..77b3780 100755
--- a/nagios-checks/nagios-check-libs
+++ b/nagios-checks/nagios-check-libs
@@ -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");
@@ -170,6 +171,10 @@ LINE: for my $line (@lsof) {
my $inode = $fields{i};
my $path = $fields{n};
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);