projects
/
mirror
/
dsa-nagios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f50ffdd
)
set $user to <unknown> if lsof could not tell the username
author
Evgeni Golov
<evgeni@debian.org>
Sat, 24 Sep 2016 09:25:33 +0000
(11:25 +0200)
committer
Peter Palfrader
<peter@palfrader.org>
Sat, 24 Sep 2016 09:54:42 +0000
(11:54 +0200)
this happens e.g. on hosts that run containers in own user namespaces
without, the output will be full of warnings:
Use of uninitialized value $user in hash element at dsa-check-libs line 188.
Signed-off-by: Peter Palfrader <peter@palfrader.org>
dsa-nagios-checks/checks/dsa-check-libs
patch
|
blob
|
history
diff --git
a/dsa-nagios-checks/checks/dsa-check-libs
b/dsa-nagios-checks/checks/dsa-check-libs
index
aaaf1ee
..
fd9e338
100755
(executable)
--- a/
dsa-nagios-checks/checks/dsa-check-libs
+++ b/
dsa-nagios-checks/checks/dsa-check-libs
@@
-156,7
+156,7
@@
LINE: for my $line (@lsof) {
my %fields = map { m/^(.)(.*)$/ ; $1 => $2 } grep { defined $_ and length $_ >1} split /\0/, $line;
$process = $fields{c};
$pid = $fields{p};
- $user = $fields{L};
+ $user = $fields{L}
|| '<unknown>'
;
next;
}