From 5b63531ff48e81c696b440cae0ba2ecd2cd95892 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 23 Sep 2010 18:34:17 +0000 Subject: [PATCH] -Fix previous checkin git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7600 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodestat.pm | 35 ++++++++++++++++++------ 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index eb85643eb..3177fcab5 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -529,7 +529,7 @@ sub process_request_nmap { while (<$fping>) { if (/Interesting ports on ([^ ]*) / or /Nmap scan report for ([^ ]*)/) { my $tmpnode=$1; - if ($currnode) { #search for blank line instead + if ($currnode) { #if still thinking about last node, flush him out my $status = join ',',sort keys %states ; my $appsd=""; foreach my $portnum(keys %portservices) { @@ -539,16 +539,15 @@ sub process_request_nmap { } $appsd =~ s/,$//; - unless ($status or ($installquerypossible and $status = installer_query($currnode))) { #pingable, but no *clue* as to what the state may be + if ($status or ($installquerypossible and $status = installer_query($currnode))) { #pingable, but no *clue* as to what the state may be + $ret->{$currnode}->{'status'}="ping"; + $ret->{$currnode}->{'appstatus'}=$status; + $ret->{$currnode}->{'appsd'}=$appsd; + $currnode=""; + %states=(); + } else { push @nodesetnodes,$currnode; #Aggregate call to nodeset - next; } - $ret->{$currnode}->{'status'}="ping"; - $ret->{$currnode}->{'appstatus'}=$status; - $ret->{$currnode}->{'appsd'}=$appsd; - $currnode=""; - %states=(); - next; } $currnode=$tmpnode; my $nip; @@ -586,6 +585,24 @@ sub process_request_nmap { } } } + my $status = join ',',sort keys %states ; + my $appsd=""; + foreach my $portnum(keys %portservices) { + my $app_t=$portservices{$portnum}; + if ($states{$app_t}) {$appsd .= $app_t . "=up,";} + else {$appsd .= $app_t . "=down,";} + } + $appsd =~ s/,$//; + + if ($status or ($installquerypossible and $status = installer_query($currnode))) { #pingable, but no *clue* as to what the state may be + $ret->{$currnode}->{'status'}="ping"; + $ret->{$currnode}->{'appstatus'}=$status; + $ret->{$currnode}->{'appsd'}=$appsd; + $currnode=""; + %states=(); + } else { + push @nodesetnodes,$currnode; #Aggregate call to nodeset + } if (@nodesetnodes) { $doreq->({command=>['nodeset'], node=>\@nodesetnodes,