diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index b561aceeb..d1c722e77 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -20,6 +20,7 @@ use xCAT::NetworkUtils; my %nodesetstats; +my %chainhash; my %default_ports = ( 'ftp' => '21', 'ssh' => '22', @@ -562,6 +563,10 @@ sub process_request_nmap { my %nodebyip; my @livenodes; my %unknownnodes; + my $chaintab = xCAT::Table->new('chain',-create=>0); + if ($chaintab) { + %chainhash = %{$chaintab->getNodesAttribs(\@nodes,['currstate'])}; + } foreach (@nodes) { $unknownnodes{$_}=1; my $ip = undef; @@ -645,9 +650,9 @@ sub process_request_nmap { if (/^PORT/) { next; } ($port,$state) = split; if ($port and $port =~ /^(\d*)\// and $state eq 'open') { - if ($1 eq "3001") { + if ($1 eq "3001" and $chainhash{$currnode}->[0]->{currstate} =~ /^install/) { $installquerypossible=1; #It is possible to actually query node - } else { + } elsif ($1 ne "3001") { $states{$portservices{$1}}=1; } }