From cd3b72557624b245fab23f8bbf6d08712b3b954a Mon Sep 17 00:00:00 2001 From: linggao Date: Tue, 8 May 2012 18:00:17 +0000 Subject: [PATCH] fixed the problem in rmc performance monitorng, it will ingore the error nodes instead of quiting git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12572 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-rmc/plugin/rmcmetrix.pm | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/xCAT-rmc/plugin/rmcmetrix.pm b/xCAT-rmc/plugin/rmcmetrix.pm index 5b356e597..54e9e70d5 100755 --- a/xCAT-rmc/plugin/rmcmetrix.pm +++ b/xCAT-rmc/plugin/rmcmetrix.pm @@ -146,6 +146,7 @@ sub parse_lsrsrc_output my %count = {}; foreach $line (@$output){ + if ($line =~ /^ERROR/) { next;} #skip the lines with error @value = split /::/, $line; $name = $value[0]; $name =~ s/[^A-Za-z0-9]+/'.'/; @@ -211,7 +212,7 @@ sub getmetrix my @output = (); my $rrd = undef; my $line = undef; - my $ret = undef; + my $ret = 0; my $msg = undef; my $cmd = undef; @@ -243,25 +244,26 @@ sub getmetrix if($rname eq "__ALL__"){ $cmd = "CT_MANAGEMENT_SCOPE=3 lsrsrc-api -i -s $rsrc"."::::Name::NodeNameList::$attr"; - @output = xCAT::Utils->runcmd($cmd, 0); - if($::RUNCMD_RC != 0){ - $line = join '', @output; - return ($::RUNCMD_RC, $line); - } + @output = xCAT::Utils->runcmd($cmd, -1); + #if($::RUNCMD_RC != 0){ + # $line = join '', @output; + # return ($::RUNCMD_RC, $line); + #} + #print "+++++ rsrc=$rsrc\nattrs=@attrs\noutput=@output\n"; &parse_lsrsrc_output($rsrc, \@attrs, \@output); } else { @names = split /,/, $rname; foreach $name (@names){ $cmd = "CT_MANAGEMENT_SCOPE=3 lsrsrc-api -i -s $rsrc"."::\'Name==\"$name\"\'::Name::NodeNameList::$attr"; - @output = xCAT::Utils->runcmd($cmd, 0); - if($::RUNCMD_RC){ - $line = join '', @output; - return ($::RUNCMD_RC, $line); - } + @output = xCAT::Utils->runcmd($cmd, -1); + #if($::RUNCMD_RC){ + # $line = join '', @output; + # return ($::RUNCMD_RC, $line); + #} + #print "--- rsrc=$rsrc\nattrs=@attrs\noutput=@output\n"; &parse_lsrsrc_output($rsrc, \@attrs, \@output); } } - foreach $attr (keys %metrix){ foreach $nnlist (keys %{$metrix{$attr}}){ if(($nnlist ne 'summary') && ($nnlist ne 'number')){