Skip to content

Commit

Permalink
stderr redirect pcmpath with unused sddpcm
Browse files Browse the repository at this point in the history
  • Loading branch information
megabreit committed Mar 17, 2021
1 parent e351f60 commit 98a5e4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions luninfo
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# Version 1.17 Fixed scsi id detection for mpioosdisks on 2145
# Version 1.18 Relax regex for getting fc adapter firmware version
# Version 1.19 added support for Purestorage Flash array
# Version 1.20 stderr redirection for pcmpath

use strict;
use warnings;
Expand All @@ -42,7 +43,7 @@ use List::Util qw( max );
use XML::Simple; # for config file
#use Data::Dumper;

my $luninfo_version="1.19";
my $luninfo_version="1.20";

my $cfgfile="/etc/luninfo.cfg";

Expand Down Expand Up @@ -737,7 +738,7 @@ sub get_all_path_prio {
# get all path priorities for sddpcm disks
sub get_all_sdd_path_prio {
return if ( ! -x "$pcmpath" );
my $pcmpath_data = qx { $pcmpath query device};
my $pcmpath_data = qx { $pcmpath query device 2>/dev/null };
my $rc=$? >> 8;
if ( $rc == 0 ) { # only when there is no error from pcmpath! There are rare occasions, where this is not right,
# e.g. after sddpcm upgrade without reboot
Expand Down Expand Up @@ -1152,7 +1153,7 @@ elsif ( $options{'fscsi'} ) {
# get SDDPCM adapter state. Important on NPIV installations since AIX adapter state (speed, link state) does not reflect reality
if ( -x "$pcmpath" ) {
my $start_marker_not_found=1;
open(CMD,"$pcmpath query adapter|") or die "Error running $pcmpath query adapter!\n";
open(CMD,"$pcmpath query adapter 2>/dev/null |") or die "Error running $pcmpath query adapter!\n";
# 0 fscsi0 NORMAL ACTIVE 68 0 2 2
# IMPORTANT: The adapter name is fscsi, NOT fcs!!
while(<CMD>) {
Expand Down

0 comments on commit 98a5e4e

Please sign in to comment.