From dee529dafda31737241d43b13e6898d6ee5590b2 Mon Sep 17 00:00:00 2001 From: phamt Date: Wed, 12 Oct 2011 04:27:51 +0000 Subject: [PATCH] Change start/stop subrouting so that when monstart/monstop gangliamon -r is invoked, gmetad/gmond on the localhost does not restart. If you invoke monstart/monstop gangliamon -r for one node, gmetad/gmond restarts on that one node, BUT gmetad/gmond is also restarted on the localhost. This causes all data to be lost for other nodes being monitored. With this change, monstart/monstop gangliamon -r will ONLY start/stop monitor on given nodes and NOT on localhost. monstart/monstop gangliamon without the "-r" will start/stop the monitoring on the localhost. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10749 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/monitoring/gangliamon.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/monitoring/gangliamon.pm b/xCAT-server/lib/xcat/monitoring/gangliamon.pm index 025fe5ddb..73f51c923 100755 --- a/xCAT-server/lib/xcat/monitoring/gangliamon.pm +++ b/xCAT-server/lib/xcat/monitoring/gangliamon.pm @@ -819,17 +819,19 @@ sub stop { my $callback = shift; my $localhost = hostname(); my $OS = `uname`; - my $res_gmond; - if ( $OS =~ /AIX/ ) { - $res_gmond = `/etc/rc.d/init.d/gmond stop 2>&1`; - } - else { - $res_gmond = `/etc/init.d/gmond stop 2>&1`; - } + if (!$scope) { # Handle stopping monitoring on localhost # monstop gangliamon + + my $res_gmond; + if ( $OS =~ /AIX/ ) { + $res_gmond = `/etc/rc.d/init.d/gmond stop 2>&1`; + } + else { + $res_gmond = `/etc/init.d/gmond stop 2>&1`; + } if ($?) { if ($callback) { my $resp = {};