From: Peter Palfrader Date: Mon, 9 Feb 2015 09:26:34 +0000 (+0100) Subject: dsa-check-libs: Ignore deleted files that are open via normal file handles X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=5296d97a3107ac926030a24a1e5216da59403ee5;p=mirror%2Fdsa-nagios.git dsa-check-libs: Ignore deleted files that are open via normal file handles --- diff --git a/dsa-nagios-checks/checks/dsa-check-libs b/dsa-nagios-checks/checks/dsa-check-libs index 89d7f3a..5d49855 100755 --- a/dsa-nagios-checks/checks/dsa-check-libs +++ b/dsa-nagios-checks/checks/dsa-check-libs @@ -170,6 +170,9 @@ 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\)/); + next if ($deleted_in_path && $fd =~ /^[0-9]*$/); # Ignore deleted files that are open via normal file handles. + $path =~ s/^\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string for my $i (@{$config->{'ignorelist'}}) { my $ignore = eval($i);