summaryrefslogtreecommitdiffstats
path: root/hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-11-27 13:55:06 +0100
committerHolger Levsen <holger@layer-acht.org>2015-11-27 13:55:06 +0100
commitc8b3d6c07b21cabcdd300ec491564c24ae516c30 (patch)
tree3bb020a4e15f744d113ab046bb04e02ff5097ef4 /hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs
parentd2ed20984c0550baf084ee7fef5b64de3661b1e6 (diff)
downloadjenkins.debian.net-c8b3d6c07b21cabcdd300ec491564c24ae516c30.tar.xz
updated to ba573051 from git://anonscm.debian.org/mirror/dsa-nagios.git - thanks DSA
Diffstat (limited to 'hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs')
-rwxr-xr-xhosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs12
1 files changed, 9 insertions, 3 deletions
diff --git a/hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs b/hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs
index 977605d0..77b37805 100755
--- a/hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs
+++ b/hosts/profitbricks-build2-amd64/usr/local/sbin/nagios-check-libs
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2005, 2006, 2007, 2008, 2012 Peter Palfrader <peter@palfrader.org>
+# Copyright (C) 2005, 2006, 2007, 2008, 2012, 2015 Peter Palfrader <peter@palfrader.org>
# 2012 Uli Martens <uli@youam.net>
#
# 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=<CONFIGFILE>]\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;