Fix when running on Debian buster

Which fails with RC 25 when using File::Spec devnull
tags/zabbix-agent-addons-0.2.76-1
Daniel Berteaud 5 years ago
parent 93e207423a
commit a66e9bb827
  1. 4
      lib/Zabbix/Agent/Addons/UPS.pm

@ -3,15 +3,13 @@ package Zabbix::Agent::Addons::UPS;
use warnings; use warnings;
use strict; use strict;
use File::Which; 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) # List configured UPS (only nut is supported)
sub list_ups { sub list_ups {
my @ups = (); my @ups = ();
my $upsc = which('upsc'); my $upsc = which('upsc');
if ($upsc && -x $upsc){ if ($upsc && -x $upsc){
my @out = qx($upsc -l); my @out = qx($upsc -l 2>/dev/null);
if ($? == 0){ if ($? == 0){
@ups = @out; @ups = @out;
chomp @ups; chomp @ups;

Loading…
Cancel
Save