From 5296d97a3107ac926030a24a1e5216da59403ee5 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 9 Feb 2015 10:26:34 +0100 Subject: [PATCH] dsa-check-libs: Ignore deleted files that are open via normal file handles --- dsa-nagios-checks/checks/dsa-check-libs | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.20.1