From 35918d2dab51d689a8dc97647e39da93901cb2c8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 5 Sep 2005 14:38:41 +0000 Subject: Use new logic suggested by aba git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@14 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- nagios-check-libs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nagios-check-libs b/nagios-check-libs index de5c138..022c261 100755 --- a/nagios-check-libs +++ b/nagios-check-libs @@ -64,16 +64,16 @@ sub getUsers() { -print STDERR "Running $LSOF -n +L\n" if $params->{'verbose'}; -open (LSOF, "$LSOF -n +L|") or die ("Cannot run $LSOF -n +L: $!\n"); +print STDERR "Running $LSOF -n\n" if $params->{'verbose'}; +open (LSOF, "$LSOF -n|") or die ("Cannot run $LSOF -n: $!\n"); my @lsof=; close LSOF; if ($CHILD_ERROR) { # program failed - die("$LSOF -n +L returned with non-zero exit code: ".($CHILD_ERROR / 256)."\n"); + die("$LSOF -n returned with non-zero exit code: ".($CHILD_ERROR / 256)."\n"); }; for my $line (@lsof) { - if ($line =~ m/path inode=/) { + if ($line =~ m/\.dpkg-/) { my ($process, $pid, $user, $rest) = split /\s+/, $line; #$processes{$user}->{$process} = [] unless defined $processes{$user}->{$process}; $processes{$user}->{$process}->{$pid} = 1; -- cgit v1.2.3