From 6864c01dcf0cf721307eb06a8f365dffd8bbb94b Mon Sep 17 00:00:00 2001 From: ellen56 Date: Tue, 31 Mar 2009 09:44:14 +0000 Subject: [PATCH] fix bug 2685896 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3053 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/monitoring/gangliamon.pm | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/xCAT-server/lib/xcat/monitoring/gangliamon.pm b/xCAT-server/lib/xcat/monitoring/gangliamon.pm index de304ea96..3143b20af 100755 --- a/xCAT-server/lib/xcat/monitoring/gangliamon.pm +++ b/xCAT-server/lib/xcat/monitoring/gangliamon.pm @@ -146,15 +146,20 @@ sub start } } #closing foreach2 } #closing foreach1 - my $rec = join(',',@children); - my $result; - if ( $OS =~ /AIX/ ) - { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond restart 2>&1`; - } - else - { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond restart 2>&1`; + my $rec = undef; + my $result = undef; + if(exists($children[0])){ + $rec = join(',',@children); + } + if($rec){ + if ( $OS =~ /AIX/ ) + { + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond restart 2>&1`; + } + else + { + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond restart 2>&1`; + } } if ($result) @@ -1063,17 +1068,21 @@ sub stop } } #closing foreach2 } #closing foreach1 - my $rec = join(',',@children); - my $result; - - if ( $OS =~ /AIX/ ) - { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond stop 2>&1`; + my $result = undef; + my $rec = undef; + if( exists($children[0]) ){ + $rec = join(',',@children); + } + if($rec){ + if ( $OS =~ /AIX/ ) + { + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond stop 2>&1`; + } + else + { + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond stop 2>&1`; + } } - else - { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond stop 2>&1`; - } if ($result) {