From a66e9bb827967d509bd1f9c2669dcc4ff48438ff Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 30 Jul 2019 13:59:42 +0200 Subject: [PATCH] Fix when running on Debian buster Which fails with RC 25 when using File::Spec devnull --- lib/Zabbix/Agent/Addons/UPS.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Zabbix/Agent/Addons/UPS.pm b/lib/Zabbix/Agent/Addons/UPS.pm index 6c2e2bd..3db6c27 100644 --- a/lib/Zabbix/Agent/Addons/UPS.pm +++ b/lib/Zabbix/Agent/Addons/UPS.pm @@ -3,15 +3,13 @@ package Zabbix::Agent::Addons::UPS; use warnings; use strict; use File::Which; -use File::Spec; -open STDERR, '>', File::Spec->devnull() or die "could not open STDERR: $!\n"; # List configured UPS (only nut is supported) sub list_ups { my @ups = (); my $upsc = which('upsc'); if ($upsc && -x $upsc){ - my @out = qx($upsc -l); + my @out = qx($upsc -l 2>/dev/null); if ($? == 0){ @ups = @out; chomp @ups;