Skip to content

Commit

Permalink
Merge pull request #1 from ganglia/master
Browse files Browse the repository at this point in the history
Update ganglia master
  • Loading branch information
Chris Dessonville committed Oct 2, 2014
2 parents 6df16c8 + 88cdaa9 commit 13cae47
Show file tree
Hide file tree
Showing 43 changed files with 8,995 additions and 8,060 deletions.
146 changes: 114 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,148 @@ GWEB_STATEDIR = /var/lib/ganglia-web
# Gmetad rootdir (parent location of rrd folder)
GMETAD_ROOTDIR = /var/lib/ganglia

APACHE_USER = www-data
#APACHE_USER = www-data
#APACHE_GROUP = www-data
##########################################################

ifndef APACHE_USER
$(info APACHE_USER is not set using www-data)
APACHE_USER = www-data
endif

ifndef APACHE_GROUP
$(info APACHE_GROUP is not set, using $(APACHE_USER))
APACHE_GROUP = $(APACHE_USER)
endif

# Gweb version
GWEB_VERSION = 3.7.0

DIST_NAME = ganglia-web
DIST_DIR = $(DIST_NAME)-$(GWEB_VERSION)
DIST_TARBALL = $(DIST_DIR).tar.gz

TARGETS = conf_default.php ganglia-web.spec version.php apache.conf
# TARGETS: Files that needs to be patched with user chosen variables
TARGETS = conf_default.php conf_redirect.php apache.conf

# DIST_GZIP_TARGETS targets that needs to be patched once before dist-gzip
# basicaly version and default values.
DIST_GZIP_TARGETS = ganglia-web.spec version.php

all: default

default: $(TARGETS)

clean:
rm -rf $(TARGETS) $(DIST_DIR) $(DIST_TARBALL) rpmbuild
@echo -n "Cleaning build files ............................... "
@rm -rf $(TARGETS) $(DIST_DIR) $(DIST_TARBALL) rpmbuild
@echo "DONE."

conf_default.php: conf_default.php.in
sed -e "s|@vargmetadir@|$(GMETAD_ROOTDIR)|" -e "s|@vargwebstatedir@|$(GWEB_STATEDIR)|g" conf_default.php.in > conf_default.php
@echo -n "Generating conf_default.php ........................ "
@sed -e "s|@vargmetadir@|$(GMETAD_ROOTDIR)|" -e "s|@vargwebdir@|$(GWEB_STATEDIR)|g" conf_default.php.in > conf_default.php
@echo "DONE."

conf_redirect.php: conf_redirect.php.in
@echo -n "Generating conf_redirect.php ....................... "
@sed -e "s|@etcdir@|$(GCONFDIR)|" conf_redirect.php.in > conf_redirect.php
@echo "DONE."

ganglia-web.spec: ganglia-web.spec.in
sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ -e "s|@vargwebdir@|$(GWEB_STATEDIR)|" -e "s|@varapacheuser@|$(APACHE_USER)|g" -e "s|@etcdir@|$(GCONFDIR)|g" ganglia-web.spec.in > ganglia-web.spec
@echo -n "Generating ganglia-web.spec ........................ "
@sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ -e "s|@vargwebdir@|$(GWEB_STATEDIR)|" -e "s|@GDESTDIR@|$(GDESTDIR)|g" -e "s|@etcdir@|$(GCONFDIR)|g" ganglia-web.spec.in > ganglia-web.spec
@echo "DONE."

version.php: version.php.in
sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ version.php.in > version.php
@echo -n "Generating version.php ............................. "
@sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ version.php.in > version.php
@echo "DONE."

apache.conf: apache.conf.in
sed -e "s|@GDESTDIR@|$(GDESTDIR)|g" apache.conf.in > apache.conf
@echo -n "Generating apache.conf ............................. "
@sed -e "s|@GDESTDIR@|$(GDESTDIR)|g" apache.conf.in > apache.conf
@echo "DONE."

dist-dir: default
rsync --exclude "rpmbuild" --exclude "*.gz" --exclude "Makefile" --exclude "*debian*" --exclude "$(DIST_DIR)" --exclude ".git*" --exclude "*.in" --exclude "*~" --exclude "#*#" --exclude "ganglia-web.spec" --exclude "apache.conf" -a . $(DIST_DIR)

install: dist-dir
mkdir -p $(DESTDIR)/$(GWEB_STATEDIR)/dwoo/compiled && \
mkdir -p $(DESTDIR)/$(GWEB_STATEDIR)/dwoo/cache && \
mkdir -p $(DESTDIR)/$(GWEB_STATEDIR) && \
rsync -a $(DIST_DIR)/conf $(DESTDIR)/$(GWEB_STATEDIR) && \
mkdir -p $(DESTDIR)/$(GDESTDIR) && \
rsync --exclude "conf" -a $(DIST_DIR)/* $(DESTDIR)/$(GDESTDIR) && \
chown -R $(APACHE_USER):$(APACHE_USER) $(DESTDIR)/$(GWEB_STATEDIR)

dist-gzip: dist-dir
if [ -f $(DIST_TARBALL) ]; then \
rm -rf $(DIST_TARBALL) ;\
fi ;\
tar -czf $(DIST_TARBALL) $(DIST_DIR)/*
@echo -n "Filling dist dir ................................... "
@rsync --exclude "rpmbuild" \
--exclude "debian/ganglia-webfrontend" \
--exclude "*.gz" \
--exclude "$(DIST_DIR)" \
--exclude ".git*" \
--exclude "version.php.in" \
--exclude "ganglia-web.spec.in" \
--exclude "apache.conf" \
--exclude "conf_default.php" \
--exclude "*~" \
--exclude "#*#" \
-a . $(DIST_DIR)
@echo "DONE."

install: install-files
@echo -n "Setting ownership to the sharedstattedir files ..... "
@chown -R $(APACHE_USER):$(APACHE_GROUP) $(DESTDIR)/$(GWEB_STATEDIR)
@echo "DONE."


install-files: dist-dir
@echo -n "Creating dwoo sharedstattedir tree ................. "
@mkdir -p $(DESTDIR)/$(GWEB_STATEDIR)/dwoo/compiled
@mkdir -p $(DESTDIR)/$(GWEB_STATEDIR)/dwoo/cache
@mkdir -p $(DESTDIR)/$(GWEB_STATEDIR)/filters
@echo "DONE."
@echo -n "Installing ganglia-webfrontend low level conf ...... "
@rsync -a $(DIST_DIR)/conf $(DESTDIR)/$(GWEB_STATEDIR)
@echo "DONE."
@echo -n "Installing php files ............................... "
@mkdir -p $(DESTDIR)/$(GDESTDIR)
@rsync --exclude "conf" \
--exclude conf_redirect.php \
--exclude "*.in" \
--exclude "*.spec" \
-a $(DIST_DIR)/* $(DESTDIR)/$(GDESTDIR)
@echo "DONE."
@echo -n "Intalling redirect conf.php ........................ "
@# so it can be seen as a config file under debian packages.
@# Do the same for all distro to avoid specific case for debian.
@cp -f conf_redirect.php $(DESTDIR)/$(GDESTDIR)/conf.php
@echo "DONE."
@echo -n "Installing the generated conf_default.php file ..... "
@cp -f conf_default.php $(DESTDIR)/$(GDESTDIR)/conf_default.php
@echo "DONE."
@echo -n "Creating the etc/ganglia-webfrontend directory ..... "
@mkdir -p $(DESTDIR)/$(GCONFDIR)
@echo "DONE."
@echo -n "Installing apache.conf ............................. "
@cp -f apache.conf $(DESTDIR)/$(GCONFDIR)/
@echo "DONE."
@echo -n "Installing the editable copy of conf_default.php ... "
@cp -f conf_default.php $(DESTDIR)/$(GCONFDIR)/conf.php
@echo "DONE."

dist-gzip: dist-dir $(DIST_GZIP_TARGETS)
@echo -n "Creating tarball ................................... "
@if [ -f $(DIST_TARBALL) ]; then \
rm -rf $(DIST_TARBALL) ;\
fi
@cp -pf $(DIST_GZIP_TARGETS) $(DIST_DIR)
@tar -czf $(DIST_TARBALL) $(DIST_DIR)/*
@echo "DONE."

rpm: dist-gzip ganglia-web.spec apache.conf
rm -rf rpmbuild
mkdir rpmbuild
mkdir rpmbuild/SOURCES
mkdir rpmbuild/BUILD
mkdir rpmbuild/RPMS
mkdir rpmbuild/SRPMS
cp $(DIST_TARBALL) rpmbuild/SOURCES
cp apache.conf rpmbuild/SOURCES
rpmbuild --define '_topdir $(PWD)/rpmbuild' --define 'custom_web_prefixdir $(GDESTDIR)' -bb ganglia-web.spec
@echo -n "Creating binary rpm ................................ "
@rm -rf rpmbuild
@mkdir rpmbuild
@mkdir rpmbuild/SOURCES
@mkdir rpmbuild/BUILD
@mkdir rpmbuild/RPMS
@mkdir rpmbuild/SRPMS
@ln -s ../../$(DIST_TARBALL) rpmbuild/SOURCES/$(DIST_TARBALL)
@rpmbuild --define '_topdir $(PWD)/rpmbuild' --define 'web_prefixdir $(GDESTDIR)' -bb ganglia-web.spec
@echo "DONE."

uninstall:
@echo -n "Uninstalling ganglia-web. (conf files untouched) ... "
rm -rf $(DESTDIR)/$(GDESTDIR) $(DESTDIR)/$(GWEB_STATEDIR)
@echo "DONE."

4 changes: 2 additions & 2 deletions aggregate_graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function createAggregateGraph() {
$available_metrics = array();
retrieve_metrics_cache("metric_list");

ksort($index_array['metrics']);
foreach ($index_array['metrics'] as $value) {
asort($index_array['metrics']);
foreach ($index_array['metrics'] as $key => $value) {
$available_metrics[] = "\"$value\"";
}

Expand Down
4 changes: 2 additions & 2 deletions cluster_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ function get_load_heatmap($hosts_up, $host_regex, $metrics, $data, $sort) {
$data->assign("sort", $sort);
$data->assign("range", $range);

$showhosts_levels = array(1 => array('checked'=>'', 'name'=>'Auto'),
2 => array('checked'=>'', 'name'=>'Same'),
$showhosts_levels = array(2 => array('checked'=>'', 'name'=>'Auto'),
1 => array('checked'=>'', 'name'=>'Same'),
0 => array('checked'=>'', 'name'=>'None'),
);
$showhosts_levels[$showhosts]['checked'] = 'checked';
Expand Down
9 changes: 7 additions & 2 deletions conf_default.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Gmetad-webfrontend version. Used to check for updates.
#
$conf['gweb_root'] = dirname(__FILE__);
$conf['gweb_confdir'] = "@vargwebstatedir@";
$conf['gweb_confdir'] = "@vargwebdir@";

include_once $conf['gweb_root'] . "/version.php";

Expand Down Expand Up @@ -136,7 +136,7 @@ $conf['mem_used_color'] = "5555cc";
$conf['mem_shared_color'] = "0000aa";
$conf['mem_cached_color'] = "33cc33";
$conf['mem_buffered_color'] = "99ff33";
$conf['mem_free_color'] = "00ff00";
$conf['mem_free_color'] = "f0ffc0";
$conf['mem_swapped_color'] = "9900CC";

#
Expand Down Expand Up @@ -433,4 +433,9 @@ $conf['display_views_using_tree'] = false;
# when the tree is first created in a browser session. Path entries are
# separated using "--"
#$conf['view_tree_nodes_initially_open'] = array();

# Gmetad will send back <EXTRA_DATA> information that is not utilized
# in many code paths. This will pre-emptively strip out the tags in
# those code paths to save time during XML parsing.
$conf['strip_extra'] = true;
?>
5 changes: 5 additions & 0 deletions conf_redirect.php.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
if( file_exists( "@etcdir@/conf.php" ) ) {
include_once "@etcdir@/conf.php";
}
?>
Binary file removed css/smoothness/images/animated-overlay.gif
Binary file not shown.
Binary file modified css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions css/smoothness/jquery-ui-1.10.2.custom.min.css

This file was deleted.

Loading

0 comments on commit 13cae47

Please sign in to comment.