From: <sai...@us...> - 2008-09-30 14:41:58
|
Revision: 2266 http://xcat.svn.sourceforge.net/xcat/?rev=2266&view=rev Author: saiprakash Date: 2008-09-30 14:39:59 +0000 (Tue, 30 Sep 2008) Log Message: ----------- modified pcp_collect Modified Paths: -------------- xcat-core/trunk/xCAT-server/sbin/pcp_collect Modified: xcat-core/trunk/xCAT-server/sbin/pcp_collect =================================================================== --- xcat-core/trunk/xCAT-server/sbin/pcp_collect 2008-09-30 14:28:03 UTC (rev 2265) +++ xcat-core/trunk/xCAT-server/sbin/pcp_collect 2008-09-30 14:39:59 UTC (rev 2266) @@ -13,6 +13,7 @@ use xCAT::GlobalDef; use xCAT_monitoring::monitorctrl; use xCAT::MsgUtils; +use xCAT_monitoring::xcatmon; use strict; use warnings; 1; @@ -60,10 +61,21 @@ no strict; no warnings; #my $i=0; + my @inactive_children; for ($i = 0;$i < $count_child;$i++) { #opening if count_child 2 - $str=`pmdumptext -c $::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config -d\xA7 -s1 -h$children[$i] -f%D:%H:%M:%S`; + $str=`pmdumptext -c $::XCATROOT/lib/perl/xCAT_monitoring/pcp/pcpmon.config -d\xA7 -s1 -h$children[$i] -f%D:%H:%M:%S 2>&1`; #print "before split is $str \n"; + #if ($str =~ /\s*No\s*route\s*to\s*host/) + if ($str =~ /pmdumptext:\s*Error:\s*host\s*"\w*":/) + { + #print "host unreachable \n"; + @inactive_children=$children[$i]; + #print "inactive children is @inactive_children \n"; + } + else + { + #print "into elso loop \n"; $str =~ s/\n//g; #print "before split_1 is $str \n"; my @spl1=split(/\xA7/,$str); @@ -118,7 +130,32 @@ $table1->setAttribs(\%key_col1, \%setting_hash); } $table1->close(); + } } #closing if count_child 2 + my %node_status=(); + #print "2nd set is @inactive_children \n"; + my $count_inactive=@inactive_children; + if ($count_inactive>0) + { + #print "more than 0 inactive children \n"; + #print "3rd set is @inactive_children \n"; + $node_status{$::STATUS_INACTIVE}=\@inactive_children; + my $changed1=$nodes_status{$::STATUS_INACTIVE}; + #print "the changed1 is $changed1 \n"; + my @final_inactive=@$changed1; + #print "final inactive is @final_inactive \n"; + } + + + #only set the node status for the changed ones + if (keys(%node_status) > 0) + { + #print %node_status, "\n"; + #print "updating nodelist table \n"; + xCAT_monitoring::xcatmon::setNodeStatusAttributes(\%node_status); + } + + } #closing if count_child 1 } # closing subroutine \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |