From f50ffddc56451331a78862cf6e59087059c4ddd6 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sat, 24 Sep 2016 11:25:32 +0200 Subject: [PATCH] silence lsof errors esp. when running on a host with containers with user namespaces, lsof output might be full of lines like lsof: no pwd entry for UID 887434 this is not helpful and will only clutter the output sent to nagios Signed-off-by: Peter Palfrader --- dsa-nagios-checks/checks/dsa-check-libs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsa-nagios-checks/checks/dsa-check-libs b/dsa-nagios-checks/checks/dsa-check-libs index 77b3780..aaaf1ee 100755 --- a/dsa-nagios-checks/checks/dsa-check-libs +++ b/dsa-nagios-checks/checks/dsa-check-libs @@ -143,7 +143,7 @@ sub inVserver() { my $INVSERVER = inVserver(); print STDERR "Running $LSOF -n\n" if $params->{'verbose'}; -open (LSOF, "$LSOF -n|") or dief ("Cannot run $LSOF -n: $!\n"); +open (LSOF, "$LSOF -n 2>/dev/null|") or dief ("Cannot run $LSOF -n: $!\n"); my @lsof=; close LSOF; if ($CHILD_ERROR) { # program failed -- 2.20.1