[csw-devel] SF.net SVN: gar:[6183] csw/mgar/pkg/ganglia/trunk

d_pocock at users.sourceforge.net d_pocock at users.sourceforge.net
Fri Sep 4 22:33:08 CEST 2009


Revision: 6183
          http://gar.svn.sourceforge.net/gar/?rev=6183&view=rev
Author:   d_pocock
Date:     2009-09-04 20:33:08 +0000 (Fri, 04 Sep 2009)

Log Message:
-----------
ganglia: Add support for gmetad, web, python, devel packages

Modified Paths:
--------------
    csw/mgar/pkg/ganglia/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.postinstall
    csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.preremove
    csw/mgar/pkg/ganglia/trunk/files/conf.php
    csw/mgar/pkg/ganglia/trunk/files/gmetad.conf
    csw/mgar/pkg/ganglia/trunk/files/httpd-ganglia.conf.CSW

Modified: csw/mgar/pkg/ganglia/trunk/Makefile
===================================================================
--- csw/mgar/pkg/ganglia/trunk/Makefile	2009-09-04 18:41:55 UTC (rev 6182)
+++ csw/mgar/pkg/ganglia/trunk/Makefile	2009-09-04 20:33:08 UTC (rev 6183)
@@ -2,6 +2,15 @@
 GARVERSION = 3.1.2
 CATEGORIES = utils
 
+# How should we set this?
+# There is a release number in configure.in, maybe use that?
+# RELVER =
+
+USER_GMOND = nobody
+# nobody shouldn't really be allowed to own any files
+# maybe we should add a ganglia user to own the RRD files?
+USER_GMETAD = nobody
+
 DESCRIPTION = A scalable distributed monitoring system
 define BLURB
   Ganglia is a scalable distributed monitoring system for high-performance computing
@@ -12,23 +21,39 @@
 SF_PROJ = ganglia
 MASTER_SITES = $(SF_MIRRORS)
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
-#DISTFILES += $(call admfiles,CSWpackage,)
+DISTFILES += CSWgangliaweb.postinstall CSWgangliaweb.preremove
+DISTFILES += httpd-ganglia.conf.CSW
 
-PACKAGES = CSWgangliaagent CSWgangliart
+PACKAGES = CSWgangliaagent CSWgangliart CSWgangliadevel CSWgangliagmetad CSWgangliaweb CSWgangliamodpython
 
 CATALOGNAME_CSWganglia		= ganglia
 CATALOGNAME_CSWgangliart	= ganglia_rt
 CATALOGNAME_CSWgangliaagent	= ganglia_agent
+CATALOGNAME_CSWgangliamodpython	= ganglia_modpython
+CATALOGNAME_CSWgangliadevel	= ganglia_devel
+CATALOGNAME_CSWgangliagmetad	= ganglia_gmetad
+CATALOGNAME_CSWgangliaweb	= ganglia_web
 
 SPKG_DESC_CSWganglia		= Dummy package
 SPKG_DESC_CSWgangliart		= Ganglia runtime libraries
 SPKG_DESC_CSWgangliaagent	= Ganglia performance monitoring agent gmond
+SPKG_DESC_CSWgangliamodpython	= Ganglia agent module for Python metrics
+SPKG_DESC_CSWgangliadevel	= Ganglia headers for metric module development
+SPKG_DESC_CSWgangliagmetad	= Ganglia gmetad
+SPKG_DESC_CSWgangliaweb		= Ganglia web
 
-PREREQUISITE_PKGS = CSWexpat CSWlibconfuse CSWapache2rt
+PREREQUISITE_PKGS = CSWexpat CSWlibconfuse CSWapache2rt CSWapache2-devel CSWrrd
 
 REQUIRED_PKGS_CSWgangliart = CSWexpat CSWlibconfuse CSWapache2rt
 REQUIRED_PKGS_CSWgangliaagent = CSWexpat CSWlibconfuse CSWapache2rt
 REQUIRED_PKGS_CSWgangliaagent += CSWgangliart
+REQUIRED_PKGS_CSWgangliamodpython = CSWlibconfuse CSWapache2rt CSWgangliart
+REQUIRED_PKGS_CSWgangliamodpython += CSWgangliaagent
+REQUIRED_PKGS_CSWgangliadevel = CSWexpat CSWlibconfuse CSWapache2rt
+REQUIRED_PKGS_CSWgangliagmetad = CSWexpat CSWlibconfuse CSWapache2rt
+REQUIRED_PKGS_CSWgangliagmetad += CSWgangliart CSWgangliaagent CSWrrd
+REQUIRED_PKGS_CSWgangliaweb = CSWgangliagmetad 
+REQUIRED_PKGS_CSWgangliaweb += CSWapache2 CSWphp5 CSWap2modphp5 CSWrrd
 
 # We define upstream file regex so we can be notifed of new upstream software release
 UPSTREAM_MASTER_SITES = $(SF_PROJECT_SHOWFILE)=43021
@@ -42,23 +67,83 @@
 CONFIGURE_ARGS = $(DIRPATHS)
 
 # Don't build gmetad (not tested yet on Solaris, more deps required to build)
-CONFIGURE_ARGS += --without-gmetad
+#CONFIGURE_ARGS += --without-gmetad
+CONFIGURE_ARGS += --with-gmetad
 
 # Reduce dependencies, no gettext:
 CONFIGURE_ARGS += --disable-nls
 
+# Use apr from CSWapache2rt
+CONFIGURE_ARGS += --with-libapr=/opt/csw/apache2/bin/apr-1-config
+
+# Include the status module
+CONFIGURE_ARGS += --with-status
+
+# When we enable this, modpython will have to go in a separate package,
+# otherwise CSWgangliaagent will have lots of dependencies
+# TODO: define a CSWgangliamodpython package
+# Depends: some issues exist getting the Python support working on Solaris,
+# Ganglia's configure.in needs to be further enhanced for this to work
+CONFIGURE_ARGS += --without-python
+#CONFIGURE_ARGS += --with-python=/opt/csw
+
 # For Ganglia 3.1.2, the test suite doesn't compile cleanly on Solaris,
 # so we skip it.  This should be re-assessed with each new release
 # from upstream.  Proposed fixes for the test suite to be submitted
 # upstream.
 ifeq ($(GARVERSION),3.1.2)
-#TEST_TARGET = check
-TEST_SCRIPTS = skip
-test-skip:
-        $(DONADA)
+TEST_SCRIPTS = 
 endif
 
+INSTALL_SCRIPTS = $(WORKSRC)/Makefile custom
+
+WWWROOT = /opt/csw/share/www
+WWWGANGLIA = $(WWWROOT)/ganglia
+ETCGANGLIA = /opt/csw/etc/ganglia
+
 PKGFILES_CSWganglia = 
 PKGFILES_CSWgangliart = $(libdir)/libganglia.*
+PKGFILES_CSWgangliamodpython = .*python.*
+PKGFILES_CSWgangliadevel = .*/include/.*.h .*/bin/ganglia-config
+PKGFILES_CSWgangliagmetad = .*/gmetad.* /opt/csw/var/ganglia/rrds
+PKGFILES_CSWgangliaweb = $(WWWGANGLIA)/.* /opt/csw/apache2/etc/extra/.*
 
+PROTOTYPE_FILTER_CSWgangliagmetad = awk '\
+$$$$3 ~ /\/opt\/csw\/var\/ganglia\/rrds/ { $$$$5 = "nobody"; $$$$6 = "nogroup" } \
+{ print }'
+
+
+#ARCHALL_CSWgangliadevel = 1
+#ARCHALL_CSWgangliaweb = 1
+
 include gar/category.mk
+
+install-custom:
+	@ginstall -d $(DESTDIR)$(WWWGANGLIA)
+	@cd $(WORKSRC)/web; \
+		cp -R * $(DESTDIR)$(WWWGANGLIA)
+	@ginstall -D $(FILEDIR)/conf.php \
+		$(DESTDIR)$(WWWGANGLIA)/conf.php
+	@rm -rf $(DESTDIR)$(WWWGANGLIA)/*.in
+	@ginstall -D $(FILEDIR)/httpd-ganglia.conf.CSW \
+		$(DESTDIR)/opt/csw/apache2/etc/extra/httpd-ganglia.conf.CSW
+	@ginstall -d $(DESTDIR)$(ETCGANGLIA)/conf.d
+	@$(WORKSRC)/gmond/gmond -t | grep -v "^include" \
+		> $(DESTDIR)$(ETCGANGLIA)/gmond.conf
+	@echo "include ('/opt/csw/etc/ganglia/conf.d/*.conf')" \
+		>> $(DESTDIR)$(ETCGANGLIA)/gmond.conf
+#	@ginstall -D $(FILEDIR)/gmond.conf \
+#		$(DESTDIR)$(ETCGANGLIA)/gmond.conf
+	@ginstall -D $(FILEDIR)/gmetad.conf \
+		$(DESTDIR)$(ETCGANGLIA)/gmetad.conf
+	@cd $(WORKSRC)/gmond/modules/conf.d; \
+		cp -R *.conf $(DESTDIR)$(ETCGANGLIA)/conf.d
+	@rm -rf $(DESTDIR)$(ETCGANGLIA)/conf.d/example.conf \
+		$(DESTDIR)$(ETCGANGLIA)/conf.d/multicpu.conf
+ifeq ($(GARVERSION),3.1.2)
+	@rm -rf $(DESTDIR)$(ETCGANGLIA)/conf.d/modgstatus.conf
+endif
+	@ginstall -d $(DESTDIR)/opt/csw/var/ganglia/rrds
+	
+
+

Added: csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.postinstall
===================================================================
--- csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.postinstall	                        (rev 0)
+++ csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.postinstall	2009-09-04 20:33:08 UTC (rev 6183)
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+AP2EXTRADIR=/opt/csw/apache2/etc/extra
+AP2CONF=/opt/csw/apache2/etc/httpd.conf
+
+if [ -f "${AP2EXTRADIR}/httpd-ganglia.conf" ];
+then
+  echo "Existing config found"
+else
+  cp "${AP2EXTRADIR}/httpd-ganglia.conf.CSW" "${AP2EXTRADIR}/httpd-ganglia.conf"
+fi
+
+if [ -n "`grep 'Include etc/extra/httpd-ganglia.conf' ${AP2CONF}`" ]; then
+      perl -i -pne 's|#(Include etc/extra/httpd-ganglia.conf)|$1|' ${AP2CONF}
+else
+      cat << END >>${AP2CONF}
+
+Include etc/extra/httpd-ganglia.conf
+
+END
+fi
+
+cat << _EOM_
+*********************************************************************
+*    NOTICE:
+*          Ganglia has been enabled in ${AP2CONF}
+*          You will need to restart your web server
+*          To finish the install.
+*********************************************************************
+
+_EOM_
+
+exit 0

Added: csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.preremove
===================================================================
--- csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.preremove	                        (rev 0)
+++ csw/mgar/pkg/ganglia/trunk/files/CSWgangliaweb.preremove	2009-09-04 20:33:08 UTC (rev 6183)
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+PATH=/usr/bin:/usr/sbin
+
+AP2CONF=/opt/csw/apache2/etc/httpd.conf
+
+perl -i -pne 's|(?<!#)(Include etc/extra/httpd-ganglia.conf)|#$1|' ${AP2CONF}
+
+cat << _EOM_
+
+*********************************************************************
+*    NOTICE:
+*          Ganglia has been disabled in ${AP2CONF}
+*          You will need to restart your web server
+*          To finish the removal.
+*********************************************************************
+
+_EOM_
+
+exit 0
+

Added: csw/mgar/pkg/ganglia/trunk/files/conf.php
===================================================================
--- csw/mgar/pkg/ganglia/trunk/files/conf.php	                        (rev 0)
+++ csw/mgar/pkg/ganglia/trunk/files/conf.php	2009-09-04 20:33:08 UTC (rev 6183)
@@ -0,0 +1,191 @@
+<?php
+# $Id: conf.php.in 1831 2008-09-26 12:18:54Z carenas $
+#
+# Gmetad-webfrontend version. Used to check for updates.
+#
+include_once "./version.php";
+
+#
+# The name of the directory in "./templates" which contains the
+# templates that you want to use. Templates are like a skin for the
+# site that can alter its look and feel.
+#
+$template_name = "default";
+
+#
+# If you installed gmetad in a directory other than the default
+# make sure you change it here.
+#
+
+# Where gmetad stores the rrd archives.
+$gmetad_root = "/opt/csw/var/ganglia";
+$rrds = "$gmetad_root/rrds";
+
+# Leave this alone if rrdtool is installed in $gmetad_root,
+# otherwise, change it if it is installed elsewhere (like /usr/bin)
+define("RRDTOOL", "/opt/csw/bin/rrdtool");
+
+# Location for modular-graph files.
+$graphdir='./graph.d';
+
+#
+# If you want to grab data from a different ganglia source specify it here.
+# Although, it would be strange to alter the IP since the Round-Robin
+# databases need to be local to be read. 
+#
+$ganglia_ip = "127.0.0.1";
+$ganglia_port = 8652;
+
+#
+# The maximum number of dynamic graphs to display.  If you set this
+# to 0 (the default) all graphs will be shown.  This option is
+# helpful if you are viewing the web pages from a browser with a 
+# small pipe.
+#
+$max_graphs = 0;
+
+#
+# In the Cluster View this sets the default number of columns used to
+# display the host grid below the summary graphs.
+#
+$hostcols = 4;
+
+#
+# In the Host View this sets the default number of columns used to
+# display the metric grid below the summary graphs.
+#
+$metriccols = 2;
+
+#
+# Turn on and off the Grid Snapshot. Now that we have a
+# hierarchical snapshot (per-cluster instead of per-node) on
+# the meta page this makes more sense. Most people will want this
+# on.
+#
+$show_meta_snapshot = "yes";
+
+# 
+# The default refresh frequency on pages.
+#
+$default_refresh = 300;
+
+#
+# Colors for the CPU report graph
+#
+$cpu_user_color = "3333bb";
+$cpu_nice_color = "ffea00";
+$cpu_system_color = "dd0000";
+$cpu_wio_color = "ff8a60";
+$cpu_idle_color = "e2e2f2";
+
+#
+# Colors for the MEMORY report graph
+#
+$mem_used_color = "5555cc";
+$mem_shared_color = "0000aa";
+$mem_cached_color = "33cc33";
+$mem_buffered_color = "99ff33";
+$mem_free_color = "00ff00";
+$mem_swapped_color = "9900CC";
+
+#
+# Colors for the LOAD report graph
+#
+$load_one_color = "CCCCCC";
+$proc_run_color = "0000FF";
+$cpu_num_color  = "FF0000";
+$num_nodes_color = "00FF00";
+
+# Other colors
+$jobstart_color = "ff3300";
+
+#
+# Colors for the load ranks.
+#
+$load_colors = array(
+   "100+" => "ff634f",
+   "75-100" =>"ffa15e",
+   "50-75" => "ffde5e",
+   "25-50" => "caff98",
+   "0-25" => "e2ecff",
+   "down" => "515151"
+);
+
+#
+# Load scaling
+#
+$load_scale = 1.0;
+
+#
+# Default color for single metric graphs
+#
+$default_metric_color = "555555";
+
+#
+# Default metric 
+#
+$default_metric = "load_one";
+
+#
+# remove the domainname from the FQDN hostnames in graphs
+# (to help with long hostnames in small charts)
+#
+$strip_domainname = false;
+
+#
+# Optional summary graphs
+#
+#$optional_graphs = array('packet');
+
+# 
+# Time ranges
+# Each value is the # of seconds in that range.
+#
+$time_ranges = array(
+   'hour'=>3600,
+   'day'=>86400,
+   'week'=>604800,
+   'month'=>2419200,
+   'year'=>31449600
+);
+
+# this key must exist in $time_ranges
+$default_time_range = 'hour';
+
+#
+# Graph sizes
+#
+$graph_sizes = array(
+   'small'=>array(
+     'height'=>40,
+     'width'=>130,
+     'fudge_0'=>0,
+     'fudge_1'=>0,
+     'fudge_2'=>0
+   ),
+   'medium'=>array(
+     'height'=>75,
+     'width'=>300,
+     'fudge_0'=>0,
+     'fudge_1'=>14,
+     'fudge_2'=>28
+   ),
+   'large'=>array(
+     'height'=>600,
+     'width'=>800,
+     'fudge_0'=>0,
+     'fudge_1'=>0,
+     'fudge_2'=>0
+   ),
+   # this was the default value when no other size was provided.
+   'default'=>array(
+     'height'=>100,
+     'width'=>400,
+     'fudge_0'=>0,
+     'fudge_1'=>0,
+     'fudge_2'=>0
+   )
+);
+$default_graph_size = 'default';
+$graph_sizes_keys = array_keys( $graph_sizes );
+?>

Added: csw/mgar/pkg/ganglia/trunk/files/gmetad.conf
===================================================================
--- csw/mgar/pkg/ganglia/trunk/files/gmetad.conf	                        (rev 0)
+++ csw/mgar/pkg/ganglia/trunk/files/gmetad.conf	2009-09-04 20:33:08 UTC (rev 6183)
@@ -0,0 +1,116 @@
+# This is an example of a Ganglia Meta Daemon configuration file
+#                http://ganglia.sourceforge.net/
+#
+# $Id: gmetad.conf.in 1639 2008-08-09 23:30:32Z carenas $
+#
+#-------------------------------------------------------------------------------
+# Setting the debug_level to 1 will keep daemon in the forground and
+# show only error messages. Setting this value higher than 1 will make 
+# gmetad output debugging information and stay in the foreground.
+# default: 0
+# debug_level 10
+#
+#-------------------------------------------------------------------------------
+# What to monitor. The most important section of this file. 
+#
+# The data_source tag specifies either a cluster or a grid to
+# monitor. If we detect the source is a cluster, we will maintain a complete
+# set of RRD databases for it, which can be used to create historical 
+# graphs of the metrics. If the source is a grid (it comes from another gmetad),
+# we will only maintain summary RRDs for it.
+#
+# Format: 
+# data_source "my cluster" [polling interval] address1:port addreses2:port ...
+# 
+# The keyword 'data_source' must immediately be followed by a unique
+# string which identifies the source, then an optional polling interval in 
+# seconds. The source will be polled at this interval on average. 
+# If the polling interval is omitted, 15sec is asssumed. 
+#
+# A list of machines which service the data source follows, in the 
+# format ip:port, or name:port. If a port is not specified then 8649
+# (the default gmond port) is assumed.
+# default: There is no default value
+#
+# data_source "my cluster" 10 localhost  my.machine.edu:8649  1.2.3.5:8655
+# data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651
+# data_source "another source" 1.3.4.7:8655  1.3.4.8
+
+data_source "my cluster" localhost
+
+#
+# Round-Robin Archives
+# You can specify custom Round-Robin archives here (defaults are listed below)
+#
+# RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \
+#      "RRA:AVERAGE:0.5:5760:374"
+#
+
+#
+#-------------------------------------------------------------------------------
+# Scalability mode. If on, we summarize over downstream grids, and respect
+# authority tags. If off, we take on 2.5.0-era behavior: we do not wrap our output
+# in <GRID></GRID> tags, we ignore all <GRID> tags we see, and always assume
+# we are the "authority" on data source feeds. This approach does not scale to
+# large groups of clusters, but is provided for backwards compatibility.
+# default: on
+# scalable off
+#
+#-------------------------------------------------------------------------------
+# The name of this Grid. All the data sources above will be wrapped in a GRID
+# tag with this name.
+# default: unspecified
+# gridname "MyGrid"
+#
+#-------------------------------------------------------------------------------
+# The authority URL for this grid. Used by other gmetads to locate graphs
+# for our data sources. Generally points to a ganglia/
+# website on this machine.
+# default: "http://hostname/ganglia/",
+#   where hostname is the name of this machine, as defined by gethostname().
+# authority "http://mycluster.org/newprefix/"
+#
+#-------------------------------------------------------------------------------
+# List of machines this gmetad will share XML with. Localhost
+# is always trusted. 
+# default: There is no default value
+# trusted_hosts 127.0.0.1 169.229.50.165 my.gmetad.org
+#
+#-------------------------------------------------------------------------------
+# If you want any host which connects to the gmetad XML to receive
+# data, then set this value to "on"
+# default: off
+# all_trusted on
+#
+#-------------------------------------------------------------------------------
+# If you don't want gmetad to setuid then set this to off
+# default: on
+# setuid off
+#
+#-------------------------------------------------------------------------------
+# User gmetad will setuid to (defaults to "nobody")
+# default: "nobody"
+# setuid_username "nobody"
+#
+#-------------------------------------------------------------------------------
+# The port gmetad will answer requests for XML
+# default: 8651
+# xml_port 8651
+#
+#-------------------------------------------------------------------------------
+# The port gmetad will answer queries for XML. This facility allows
+# simple subtree and summation views of the XML tree.
+# default: 8652
+# interactive_port 8652
+#
+#-------------------------------------------------------------------------------
+# The number of threads answering XML requests
+# default: 4
+# server_threads 10
+#
+#-------------------------------------------------------------------------------
+# Where gmetad stores its round-robin databases
+# default: "/var/lib/ganglia/rrds"
+# rrd_rootdir "/some/other/place"
+rrd_rootdir "/opt/csw/var/ganglia/rrds"
+

Added: csw/mgar/pkg/ganglia/trunk/files/httpd-ganglia.conf.CSW
===================================================================
--- csw/mgar/pkg/ganglia/trunk/files/httpd-ganglia.conf.CSW	                        (rev 0)
+++ csw/mgar/pkg/ganglia/trunk/files/httpd-ganglia.conf.CSW	2009-09-04 20:33:08 UTC (rev 6183)
@@ -0,0 +1,13 @@
+
+Alias /ganglia "/opt/csw/share/www/ganglia"
+
+<Directory "/opt/csw/share/www/ganglia">
+    AllowOverride None
+    DirectoryIndex index.html index.php
+    <Limit GET OPTIONS>
+        Order allow,deny
+        Allow from all
+    </Limit>
+</Directory>
+
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list