diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index bb332bb13..05014a585 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -15,6 +15,7 @@ use lib "$::XCATROOT/lib/perl"; use strict; use warnings "all"; use Time::HiRes qw/time/; +use xCAT::SvrUtils; use IO::Socket::INET qw/!AF_INET6 !PF_INET6/; my $initialtimeout = 0.5; @@ -415,6 +416,10 @@ sub subcmd { my %args = @_; $self->{expectedcmd} = $args{command}; $self->{expectednetfn} = $args{netfn} + 1; + if ($self->{onlogon_args}->{xcatdebugmodel}) { + my $msg = sprintf ("The command running: $self->{onlogon_args}->{command}:$self->{onlogon_args}->{subcommand}(@{$self->{onlogon_args}->{extraargs}}), the raw data: netfn(0x%02x), cmd(0x%02x)", $args{netfn}, $args{command}); + xCAT::SvrUtils::sendmsg([0, $msg], $self->{onlogon_args}->{outfunc}); + } my $seqincrement = 7; while ($tabooseq{ $self->{expectednetfn} }->{ $self->{expectedcmd} }->{ $self->{seqlun} } and $seqincrement) { #avoid using a seqlun formerly marked 'taboo', but don't advance by more than 7, just in case $tabooseq{ $self->{expectednetfn} }->{ $self->{expectedcmd} }->{ $self->{seqlun} }--; #forgive a taboo lun over time... diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index ae76557c1..e505d62eb 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -43,6 +43,7 @@ my %allerrornodes = (); my %newnodestatus = (); my $global_sessdata; my %child_pids; +my $xcatdebugmodel = 0; my $IPMIXCAT = "/opt/xcat/bin/ipmitool-xcat"; my $NON_BLOCK = 1; @@ -8162,6 +8163,7 @@ sub process_request { if ($::XCATSITEVALS{ipmitimeout}) { $ipmitimeout = $::XCATSITEVALS{ipmitimeout} } if ($::XCATSITEVALS{ipmiretries}) { $ipmitrys = $::XCATSITEVALS{ipmitretries} } if ($::XCATSITEVALS{ipmisdrcache}) { $enable_cache = $::XCATSITEVALS{ipmisdrcache} } + if ($::XCATSITEVALS{xcatdebugmodel}) { $xcatdebugmodel = $::XCATSITEVALS{xcatdebugmodel} } #my @threads; my @donargs = (); @@ -8375,6 +8377,8 @@ sub donode { command => $command, extraargs => \@exargs, subcommand => $exargs[0], + xcatdebugmodel => $xcatdebugmodel, + outfunc => $callback, }; if ($sessiondata{$node}->{ipmisession}->{error}) { xCAT::SvrUtils::sendmsg([ 1, $sessiondata{$node}->{ipmisession}->{error} ], $callback, $node, %allerrornodes);