From 245bf447ab9c935860b15b734b38394bf8fe8f96 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Fri, 27 Aug 2010 01:45:43 +0000 Subject: [PATCH] delete the dependence on xcat-rmc git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7271 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/web.pm | 32 ++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/web.pm b/xCAT-server/lib/xcat/plugins/web.pm index d9c84fae7..dba1e5bcf 100644 --- a/xCAT-server/lib/xcat/plugins/web.pm +++ b/xCAT-server/lib/xcat/plugins/web.pm @@ -18,7 +18,6 @@ use Data::Dumper; use LWP::Simple; use xCAT::Table; use xCAT::NodeRange; -use xCAT_monitoring::rmcmon; sub handled_commands { @@ -498,8 +497,7 @@ sub web_rmcmonShow(){ my $retInfo; my $retHash = {}; my $output; - my $activeNodes; - my $inactiveNodes; + my @activeNodes; my @rmcNodes; my $tempNodes; my $temp = ""; @@ -541,21 +539,31 @@ sub web_rmcmonShow(){ if ('lpar' eq $nodeRange){ #get nodes detail containt @nodes = xCAT::NodeRange::noderange($nodeRange); - my %nodesStatus = xCAT_monitoring::rmcmon->pingNodeStatus(@nodes); - $inactiveNodes = $nodesStatus{$::STATUS_INACTIVE}; - $activeNodes = $nodesStatus{$::STATUS_ACTIVE}; + if ((@nodes)&& (@nodes > 0)) { + #get all the active nodes + $temp= join(' ', @nodes); + $output =`fping -a $temp 2> /dev/null`; + chomp($output); + @activeNodes = split(/\n/, $output); - #non-accessable - foreach (@$inactiveNodes){ - push(@{$retHash->{node}},{name=>$_, data=>'NA'}); - } + #get all the inactive nodes by substracting the active nodes from all. + my %temp2; + foreach(@activeNodes) { + $temp2{$_}=1; + } + foreach(@nodes) { + if (!$temp2{$_}) { + push(@{$retHash->{node}},{name=>$_, data=>'NA'}); + } + } + } - if (@$activeNodes < 1){ + if (@activeNodes < 1){ $callback->($retHash); return; } - $tempNodes = join(',', @$activeNodes); + $tempNodes = join(',', @activeNodes); $output = xCAT::Utils->runcmd("xdsh $tempNodes rpm -q rsct.core", -1, 1); #non-installed foreach(@$output){