diff options
author | Peter Palfrader <peter@palfrader.org> | 2016-09-24 11:14:56 +0200 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2016-09-24 11:14:56 +0200 |
commit | 4f9b2d8f679f98cb7a9db8d62471d1bc009d6693 (patch) | |
tree | 68c5ed74a7a37c9b0a9022e9240cb96afce4d3b2 | |
parent | 42d266e0efb35f61fafcb75d210976ecc1c730cb (diff) |
merge dsa-check-libs changes into this check-libs
-rwxr-xr-x | nagios-checks/nagios-check-libs | 5 |
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); |