summaryrefslogtreecommitdiff
path: root/nagios-checks/nagios-check-libs
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2016-09-24 11:14:56 +0200
committerPeter Palfrader <peter@palfrader.org>2016-09-24 11:14:56 +0200
commit4f9b2d8f679f98cb7a9db8d62471d1bc009d6693 (patch)
tree68c5ed74a7a37c9b0a9022e9240cb96afce4d3b2 /nagios-checks/nagios-check-libs
parent42d266e0efb35f61fafcb75d210976ecc1c730cb (diff)
merge dsa-check-libs changes into this check-libs
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);