From fb696fa327a00852582b1f321a902b5ddbc4ea6a Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 11 Sep 2015 10:20:52 +0200 Subject: [PATCH] Apply changes from the dsa-puppet version of dsa-check-libs Accept -v for --verbose, Ignore deleted directories that are just our cwd. --- dsa-nagios-checks/checks/dsa-check-libs | 2 ++ dsa-nagios-checks/debian/changelog | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dsa-nagios-checks/checks/dsa-check-libs b/dsa-nagios-checks/checks/dsa-check-libs index d1a96c7..77b3780 100755 --- a/dsa-nagios-checks/checks/dsa-check-libs +++ b/dsa-nagios-checks/checks/dsa-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=]\n"); @@ -172,6 +173,7 @@ LINE: for my $line (@lsof) { 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'}}) { diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index 16cadb7..3c00a3f 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -9,7 +9,11 @@ dsa-nagios-checks (108+XXXX) UNRELEASED; urgency=medium * dsa-check-libs: also ignore files that are open via normal file handles on NFS. - -- Peter Palfrader Thu, 06 Aug 2015 09:37:24 +0200 + [ Peter Palfrader ] + * dsa-check-libs: accept -v as short for --verbose. + * dsa-check-libs: ignore deleted CWDs. + + -- Peter Palfrader Fri, 11 Sep 2015 10:21:15 +0200 dsa-nagios-checks (108) unstable; urgency=medium -- 2.20.1