From eb1ecfbc5b13815c85434f9947a747d339fd560d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 23 May 2011 18:32:29 +0000 Subject: [PATCH] -Prevent attempting query of xCAT install monitor script if the node is not in install state git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9660 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodestat.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } }