diff --git a/Makefile b/Makefile index 1c71541b..d9cdb67f 100644 --- a/Makefile +++ b/Makefile @@ -25,26 +25,25 @@ TARGETS = conf_default.php gweb.spec version.php default: $(TARGETS) clean: - rm -rf $(TARGETS) $(DIST_DIR) $(DIST_TARBALL) + rm -rf $(TARGETS) $(DIST_DIR) $(DIST_TARBALL) rpmbuild conf_default.php: conf_default.php.in sed -e "s|@varstatedir@|$(GWEB_STATEDIR)|" conf_default.php.in > conf_default.php gweb.spec: gweb.spec.in - sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ -e "s|@varstatedir@|$(GWEB_STATEDIR)|" gweb.spec.in > gweb.spec + sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ -e "s|@varstatedir@|$(GWEB_STATEDIR)|" -e "s|@varapacheuser@|$(APACHE_USER)|g" gweb.spec.in > gweb.spec version.php: version.php.in sed -e s/@GWEB_VERSION@/$(GWEB_VERSION)/ version.php.in > version.php dist-dir: default - rsync --exclude "$(DIST_DIR)" --exclude ".git*" --exclude "*~" -a . $(DIST_DIR) && \ - cp -a $(TARGETS) $(DIST_DIR) + rsync --exclude "rpmbuild" --exclude "*.gz" --exclude "Makefile" --exclude "$(DIST_DIR)" --exclude ".git*" --exclude "*.in" --exclude "*~" --exclude "#*#" --exclude "gweb.spec" -a . $(DIST_DIR) install: dist-dir - mkdir -p $(DESTDIR)/$(GWEB_DWOO) && \ - rsync --exclude debian -a $(DIST_DIR)/conf/ $(DESTDIR)/$(GANGLIA_STATEDIR)/conf && \ - cp -a $(DIST_DIR)/* $(DESTDIR) && \ - chown -R $(APACHE_USER):$(APACHE_USER) $(DESTDIR)/$(GWEB_DWOO) $(DESTDIR)/$(GANGLIA_STATEDIR)/conf + mkdir -p $(GWEB_DWOO) && \ + rsync -a $(DIST_DIR)/conf/ $(GANGLIA_STATEDIR)/conf && \ + rsync --exclude "conf" -a $(DIST_DIR)/* $(DESTDIR) && \ + chown -R $(APACHE_USER):$(APACHE_USER) $(GWEB_DWOO) $(GANGLIA_STATEDIR)/conf dist-gzip: dist-dir if [ -f $(DIST_TARBALL) ]; then \ @@ -52,6 +51,16 @@ dist-gzip: dist-dir fi ;\ tar -czf $(DIST_TARBALL) $(DIST_DIR)/* +rpm: dist-gzip gweb.spec + rm -rf rpmbuild + mkdir rpmbuild + mkdir rpmbuild/SOURCES + mkdir rpmbuild/BUILD + mkdir rpmbuild/RPMS + mkdir rpmbuild/SRPMS + cp $(DIST_TARBALL) rpmbuild/SOURCES + rpmbuild --define '_topdir $(PWD)/rpmbuild' -bb gweb.spec + uninstall: rm -rf $(DESTDIR) $(GWEB_DWOO) $(GANGLIA_STATEDIR)/conf diff --git a/conf_default.php.in b/conf_default.php.in index 0bc72ebf..72de1062 100644 --- a/conf_default.php.in +++ b/conf_default.php.in @@ -31,8 +31,8 @@ $conf['gmetad_root'] = "@varstatedir@/ganglia"; $conf['rrds'] = "${conf['gmetad_root']}/rrds"; # Where Dwoo (PHP templating engine) store compiled templates -$conf['dwoo_compiled_dir'] = "${conf['gweb_root']}/lib/dwoo/compiled"; -$conf['dwoo_cache_dir'] = "${conf['gweb_root']}/lib/dwoo/cache"; +$conf['dwoo_compiled_dir'] = "${conf['gmetad_root']}/dwoo/compiled"; +$conf['dwoo_cache_dir'] = "${conf['gmetad_root']}/dwoo/cache"; # Where to store web-based configuration $conf['views_dir'] = $conf['gmetad_root'] . '/conf'; @@ -316,14 +316,16 @@ $conf['overlay_events_line_type'] = "dashed"; $conf['overlay_events_provider'] = "json"; # Where is the Overlay events file stored $conf['overlay_events_file'] = $conf['conf_dir'] . "/events.json"; -$conf['overlay_events_color_map_file'] = $conf['conf_dir'] . "/event_color.json"; + # If using MDB2, connection string: -$conf['overlay_events_dsn'] = "mysql://dbuser:dbpasword@localhost/ganglia"; +$conf['overlay_events_dsn'] = "mysql://dbuser:dbpassword@localhost/ganglia"; + +$conf['overlay_events_color_map_file'] = $conf['conf_dir'] . "/event_color.json"; # For event shading. Value in hex, 'FF' = 100% opaque. # the _shade_ value should be less than _tick_ $conf['overlay_events_tick_alpha'] = '30'; -$conf['overlay_events_shade_alpha'] = '50'; +$conf['overlay_events_shade_alpha'] = '20'; # Colors to use e.g. in graph_colors $conf['graph_colors'] = array("0000A3", "FF3300", "FFCC33", "00CC66", "B88A00", "33FFCC", "809900", "FF3366", "FF33CC", "CC33FF", "CCFF33", "FFFF66", "33CCFF"); diff --git a/graph.php b/graph.php index 05eff49d..547966f6 100644 --- a/graph.php +++ b/graph.php @@ -38,6 +38,7 @@ sanitize($_GET["l"]) : NULL; $summary = isset($_GET["su"]) ? 1 : 0; $debug = isset($_GET['debug']) ? clean_number(sanitize($_GET["debug"])) : 0; +$showEvents = isset($_GET["event"]) ? sanitize ($_GET["event"]) : "show"; $command = ''; $graphite_url = ''; @@ -625,7 +626,8 @@ // Nagios event integration support ////////////////////////////////////////////////////////////////////////////// $nagios_events = array(); -if ( $conf['overlay_nagios_events'] && +if ( $showEvents == "show" && + $conf['overlay_nagios_events'] && ! in_array($range, $conf['overlay_events_exclude_ranges']) ) { $nagios_pull_url = $conf['overlay_nagios_base_url'] . @@ -652,7 +654,10 @@ ////////////////////////////////////////////////////////////////////////////// // Check whether user wants to overlay events on graphs ////////////////////////////////////////////////////////////////////////////// -if ( $conf['overlay_events'] && $conf['graph_engine'] == "rrdtool" && ! in_array($range, $conf['overlay_events_exclude_ranges']) ) { +if ( $showEvents == "show" && + $conf['overlay_events'] && + $conf['graph_engine'] == "rrdtool" && + ! in_array($range, $conf['overlay_events_exclude_ranges']) ) { $color_count = sizeof($conf['graph_colors']); $counter = 0; diff --git a/graph_all_periods.php b/graph_all_periods.php index 986db566..060dabcf 100644 --- a/graph_all_periods.php +++ b/graph_all_periods.php @@ -22,6 +22,7 @@ +
Decompose'; } - print ' ' . + print ' '; + + $graphId = 'graph_img_' . $key; + + print ' ' . '