# Copyright (C) 2007 Platform Computing Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # Summary: Ganglia agent component Name: component-ganglia-agent-v3_1_1 Version: 3.1.1 Release: 1 License: GPLv2 Group: System Environment/Base Vendor: Platform Computing Corporation BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildArchitectures: noarch URL: http://ganglia.sf.net/ Requires(post): coreutils, gawk, sed, /sbin/chkconfig, /sbin/service Requires: ganglia, ganglia-gmond %description Ganglia component for compute node. %prep %build %install rm -rf %{buildroot} %files %pre %post GCONF_DIR=/etc/ganglia /bin/sed -i -e 's/name \= \"unspecified\"/name \= \"Cluster\"/' $GCONF_DIR/gmond.conf #/bin/gawk 'BEGIN { found = 0; total = 0; } # { # if ($0 ~ /^udp_send_channel/) { found = 1; }; # if ($0 ~ /^udp_recv_channel/) { found = 1; }; # # if (!found) { # printf ("%s\n", $0); # } # # if (found && total <= 2) { # if ($0 ~ /^}/) { # found = 0; # total++; # } else { # if (total >= 2) { # printf("%s\n", $0); # found = 0; # } # } # } # } #' /etc/gmond.conf > /tmp/gmond.conf #/bin/mv /tmp/gmond.conf /etc/ /sbin/chkconfig --add gmond /sbin/chkconfig gmond on if [ -e /var/lock/subsys/kusu-installer ]; then exit 0; fi if [ ! -f /var/lock/subsys/gmond ]; then /sbin/service gmond start else /sbin/service gmond restart fi %preun %postun /bin/cat << 'EOF' > /opt/kusu/lib/plugins/cfmclient/ganglia-agent-v3_0.remove #!/bin/sh if [ -f /var/lock/subsys/gmond ]; then /sbin/service gmond stop /sbin/chkconfig --del gmond /sbin/chkconfig gmond off fi rpm -e ganglia-gmond ganglia EOF rm -f /opt/kusu/lib/plugins/cfmclient/ganglia-agent-v3_0.remove %clean rm -rf %{buildroot} %changelog * Fri Jan 30 2009 Hirwan Salleh 3.1.1-1 - Use Ganglia version 3.1.1 - Fix ganglia conf path * Thu Apr 17 2008 Shawn Starr 3.0-1 - Initial release.