From c8b3d6c07b21cabcdd300ec491564c24ae516c30 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 27 Nov 2015 13:55:06 +0100 Subject: updated to ba573051 from git://anonscm.debian.org/mirror/dsa-nagios.git - thanks DSA --- hosts/jenkins-test-vm/usr/local/sbin/nagios-check-libs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'hosts/jenkins-test-vm/usr/local/sbin/nagios-check-libs') diff --git a/hosts/jenkins-test-vm/usr/local/sbin/nagios-check-libs b/hosts/jenkins-test-vm/usr/local/sbin/nagios-check-libs index 977605d0..77b37805 100755 --- a/hosts/jenkins-test-vm/usr/local/sbin/nagios-check-libs +++ b/hosts/jenkins-test-vm/usr/local/sbin/nagios-check-libs @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2005, 2006, 2007, 2008, 2012 Peter Palfrader +# Copyright (C) 2005, 2006, 2007, 2008, 2012, 2015 Peter Palfrader # 2012 Uli Martens # # Permission is hereby granted, free of charge, to any person obtaining @@ -30,7 +30,7 @@ $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; my $LSOF = '/usr/bin/lsof -F0'; -my $VERSION = '0.2012042101'; +my $VERSION = '0.2015012901'; # nagios exit codes my $OK = 0; @@ -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=]\n"); @@ -169,7 +170,12 @@ LINE: for my $line (@lsof) { my $fd = $fields{f}; my $inode = $fields{i}; my $path = $fields{n}; - if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $fd eq 'DEL') { + 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); next LINE if $ignore; -- cgit v1.2.3-70-g09d2