Don't catch stderr for vgdisplay commands

Prevent useless messages from poluting the output
tags/zabbix-agent-addons-0.2.142-1
Daniel Berteaud 4 years ago
parent 6fbfb70ae0
commit b95cca848c
  1. 4
      lib/Zabbix/Agent/Addons/LVM.pm

@ -180,10 +180,10 @@ sub get_vg_information() {
my $units_arg = ''; my $units_arg = '';
$units_arg = " --units $units " if ($units); $units_arg = " --units $units " if ($units);
if ( -e "/usr/sbin/vgdisplay" ) { if ( -e "/usr/sbin/vgdisplay" ) {
@vginfo = `/usr/sbin/vgdisplay -v $units_arg`; @vginfo = `/usr/sbin/vgdisplay -v $units_arg 2>/dev/null`;
} else { } else {
if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin or /usr/sbin"); } if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin or /usr/sbin"); }
@vginfo = `/sbin/vgdisplay -v $units_arg`; @vginfo = `/sbin/vgdisplay -v $units_arg 2>/dev/null`;
} }
VGINF: foreach(@vginfo) { VGINF: foreach(@vginfo) {

Loading…
Cancel
Save