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;