From bd0d87a2c62df6d76517b6342de7be5072ae61db Mon Sep 17 00:00:00 2001 From: ellen56 Date: Mon, 13 Jul 2009 03:05:10 +0000 Subject: [PATCH] 1.revise monshow to show data for nodes whose nodetype is osi; 2. change output of monshow -s from node-sum to node-summary git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3763 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-rmc/plugin/rmcmon.pm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/xCAT-rmc/plugin/rmcmon.pm b/xCAT-rmc/plugin/rmcmon.pm index bc09205e6..6d392f752 100644 --- a/xCAT-rmc/plugin/rmcmon.pm +++ b/xCAT-rmc/plugin/rmcmon.pm @@ -1580,6 +1580,7 @@ sub show { print "rmcmon:show called\n"; no strict 'refs'; my ($noderef, $sum, $time, $attrs, $pe, $callback) = @_; + my @monnodes = (); my $rsp = {}; my $localhostname=hostname(); my $start_time = undef; @@ -1596,17 +1597,24 @@ sub show { $start_time = $end_time - $time * 60; } + foreach $node (@$noderef){ + my $table = xCAT::Table->new('nodetype'); + my $entry = $table->getNodeAttribs($node, ['nodetype']); + if($entry && ($entry->{nodetype} =~ /$::NODETYPE_OSI/)){ + push @monnodes, $node; + } + } + #the identification of this node my $isSV=xCAT::Utils->isServiceNode(); if(!$isSV && ($sum&0x2)){ - push @$noderef, $localhostname; + push @monnodes, $localhostname; } - print "$localhostname: @$noderef\n"; $sum &= 0x1; if($sum){ - foreach $node (@$noderef){ + foreach $node (@monnodes){ if($node eq $localhostname){ $rrddir = "/var/rrd/cluster"; my @metrixconf = xCAT_monitoring::rmcmetrix::get_metrix_conf(); @@ -1626,11 +1634,11 @@ sub show { $rrddir = "/var/rrd/$node"; } $output = &showmetrix($rrddir, $attrs, $start_time, $end_time); - push @{$rsp->{data}}, "\n$node-sum:"; + push @{$rsp->{data}}, "\n$node-summary:"; push @{$rsp->{data}}, @$output; } } else { - foreach $node (@$noderef){ + foreach $node (@monnodes){ $rrddir = "/var/rrd/$node"; $output = &showmetrix($rrddir, $attrs, $start_time, $end_time); push @{$rsp->{data}}, "\n$node:";