Skip to content

Commit

Permalink
attempting drawks pull
Browse files Browse the repository at this point in the history
  • Loading branch information
vuksanv committed Jan 6, 2012
1 parent caa6146 commit e7413f4
Show file tree
Hide file tree
Showing 31 changed files with 397 additions and 76 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Federico Sacerdoti <[email protected]>
Matt Massie <[email protected]>
Vladimir Vuksan <vvuksan>
Jeff Buchbinder <jbuchbinder>
Dave Rawks <drawks>
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ APACHE_USER = apache

# Gweb version
GWEB_MAJOR_VERSION = 2
GWEB_MINOR_VERSION = 1
GWEB_MICRO_VERSION = 8
GWEB_MINOR_VERSION = 2
GWEB_MICRO_VERSION = 1

# Gweb statedir (where RRD files, Dwoo templates are stored)
GWEB_STATEDIR = /var/lib
Expand Down
8 changes: 4 additions & 4 deletions api/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// Make timestamp, description and host_regex have been supplied before proceeding
header("Content-Type: text/plain");

$conf['ganglia_dir'] = dirname(dirname(__FILE__));
$conf['gweb_root'] = dirname(dirname(__FILE__));

include_once $conf['ganglia_dir'] . "/eval_conf.php";
include_once $conf['ganglia_dir'] . "/functions.php";
include_once $conf['ganglia_dir'] . "/lib/common_api.php";
include_once $conf['gweb_root'] . "/eval_conf.php";
include_once $conf['gweb_root'] . "/functions.php";
include_once $conf['gweb_root'] . "/lib/common_api.php";

if ( ! $conf['overlay_events'] ) {
api_return_error( "Events API is DISABLED. Please set \$conf['overlay_events'] = true to enable." );
Expand Down
12 changes: 6 additions & 6 deletions api/rundeck.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

header("Content-Type: text/plain");

$conf['ganglia_dir'] = dirname(dirname(__FILE__));
$conf['gweb_root'] = dirname(dirname(__FILE__));

include_once $conf['ganglia_dir'] . "/eval_conf.php";
include_once $conf['ganglia_dir'] . "/functions.php";
include_once $conf['ganglia_dir'] . "/get_context.php";
include_once $conf['gweb_root'] . "/eval_conf.php";
include_once $conf['gweb_root'] . "/functions.php";
include_once $conf['gweb_root'] . "/get_context.php";
$context = "cluster";
include_once $conf['ganglia_dir'] . "/ganglia.php";
include_once $conf['ganglia_dir'] . "/get_ganglia.php";
include_once $conf['gweb_root'] . "/ganglia.php";
include_once $conf['gweb_root'] . "/get_ganglia.php";

foreach ( $metrics as $node => $metric_array ) {

Expand Down
8 changes: 4 additions & 4 deletions api/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// will give you back the name of the cluster where host is in
/////////////////////////////////////////////////////////////////////////////

$conf['ganglia_dir'] = dirname(dirname(__FILE__));
$conf['gweb_root'] = dirname(dirname(__FILE__));

include_once $conf['ganglia_dir'] . "/eval_conf.php";
include_once $conf['ganglia_dir'] . "/lib/common_api.php";
include_once $conf['ganglia_dir'] . "/lib/functions.php";
include_once $conf['gweb_root'] . "/eval_conf.php";
include_once $conf['gweb_root'] . "/lib/common_api.php";
include_once $conf['gweb_root'] . "/lib/functions.php";

ganglia_cache_metrics();

Expand Down
8 changes: 4 additions & 4 deletions api/views.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

header("Content-Type: text/json");

$conf['ganglia_dir'] = dirname(dirname(__FILE__));
$conf['gweb_root'] = dirname(dirname(__FILE__));

include_once $conf['ganglia_dir'] . "/eval_conf.php";
include_once $conf['ganglia_dir'] . "/functions.php";
include_once $conf['ganglia_dir'] . "/lib/common_api.php";
include_once $conf['gweb_root'] . "/eval_conf.php";
include_once $conf['gweb_root'] . "/functions.php";
include_once $conf['gweb_root'] . "/lib/common_api.php";

if ( !isset($_GET['action']) ) {
api_return_error( "Error: You need to specify an action at a minimum" );
Expand Down
7 changes: 4 additions & 3 deletions conf_default.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#
# Gmetad-webfrontend version. Used to check for updates.
#
$conf['ganglia_dir'] = dirname(__FILE__);
$conf['gweb_root'] = dirname(__FILE__);

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

#
# 'readonly': No authentication is required. All users may view all resources. No edits are allowed.
Expand All @@ -31,7 +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['gmetad_root']}/dwoo";
$conf['dwoo_compiled_dir'] = "${conf['gweb_root']}/lib/dwoo/compiled";
$conf['dwoo_cache_dir'] = "${conf['gweb_root']}/lib/dwoo/cache";

# Where to store web-based configuration
$conf['views_dir'] = $conf['gmetad_root'] . '/conf';
Expand Down
16 changes: 14 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
ganglia-webfrontend (2.2.1-1) unstable; urgency=low
ganglia-webfrontend (2.2.1) unstable; urgency=low

[ Dave Rawks ]
* More tweaks to packaging to fit with debian policy
* Moved apache config to install in apache2's conf.d
* Added a conf.php which includes from /etc/ganglia-webfrontend/conf.php

-- Dave Rawks <drawks@kumonga> Thu, 29 Dec 2011 14:42:00 -0800

ganglia-webfrontend (2.2.0-0) unstable; urgency=low

[ Jeff Buchbinder ]
* Add debian packaging.

-- Jeff Buchbinder <[email protected]> Sat, 13 Aug 2011 10:33:41 -0400
[ Dave Rawks ]
* Corrected several problems with debian packaging

-- Dave Rawks <drawks@kumonga> Thu, 29 Dec 2011 11:27:04 -0800
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
7
2 changes: 2 additions & 0 deletions debian/ganglia-webfrontend.dirs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
etc/ganglia-webfrontend
usr/share/ganglia-webfrontend
usr/share/ganglia-webfrontend/lib/dwoo/compiled
usr/share/ganglia-webfrontend/lib/dwoo/cache
5 changes: 4 additions & 1 deletion debian/ganglia-webfrontend.postinst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -x

set -e

Expand All @@ -11,6 +11,9 @@ if [ "$1" = "configure" ]; then
autoconfigure="$RET"
webserver="apache2"

chown www-data /usr/share/ganglia-webfrontend/lib/dwoo/cache
chown www-data /usr/share/ganglia-webfrontend/lib/dwoo/compiled

if [ "$autoconfigure" = true ]; then
test -x /usr/sbin/$webserver || continue

Expand Down
2 changes: 1 addition & 1 deletion debian/ganglia-webfrontend.postrm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/sh -x

set -e

Expand Down
4 changes: 2 additions & 2 deletions debian/ganglia-webfrontend.templates
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

Template: ganglia-webfrontend/webserver
Type: boolean
Default: false
Default: true
_Description: Automatically configure apache2?
The ganglia front-end will be unavailable until a web server is configured.
Automatic configuration can be performed for the Apache 2 web server.

Template: ganglia-webfrontend/restart
Type: boolean
Default: false
Default: true
_Description: Restart apache2?
In order to activate the new configuration, the web server needs
to be restarted. If you choose not to do this automatically, you should
Expand Down
5 changes: 4 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ override_dh_auto_clean:
override_dh_auto_install:
dh_testdir
dh_testroot
dh_clean -k
dh_prep
dh_installdirs
# Add here commands to install the package into debian/ganglia.
$(MAKE) install APACHE_USER=www-data DESTDIR=$(CURDIR)/debian/tmp/usr/share/ganglia-webfrontend
# Install webfrontend
mkdir -p debian/ganglia-webfrontend/etc/apache2/conf.d/
cp -f debian/apache.conf \
debian/ganglia-webfrontend/etc/ganglia-webfrontend
cp -f debian/conf.php \
debian/ganglia-webfrontend/etc/ganglia-webfrontend

2 changes: 1 addition & 1 deletion debian/source/format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0 (quilt)
3.0 (native)
2 changes: 1 addition & 1 deletion edit_optional_graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function create_radio_button($variable_name, $variable_value = "ignored") {
Find available graphs by looking in the GANGLIA_DIR/graph.d directory
anything that matches _report.php
----------------------------------------------------------------------- */
if ($handle = opendir($conf['ganglia_dir'] . '/graph.d')) {
if ($handle = opendir($conf['gweb_root'] . '/graph.d')) {

// If we are using RRDtool reports can be json or PHP suffixes
if ( $conf['graph_engine'] == "rrdtool" )
Expand Down
5 changes: 5 additions & 0 deletions eval_conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"Please adjust <code>\$conf['dwoo_compiled_dir']</code>.";
}

if ( ! isset($conf['dwoo_compiled_dir']) || ! is_writeable($conf['dwoo_compiled_dir']) ) {
$errors[] = "DWOO cache directory '${conf['dwoo_cache_dir']}' is not writeable.<br/>".
"Please adjust <code>\$conf['dwoo_cache_dir']</code>.";
}

if( ! isSet($conf['views_dir']) || ! is_readable($conf['views_dir']) ) {
$errors[] = "Views directory '${conf['views_dir']}' is not readable.<br/>".
"Please adjust <code>\$conf['views_dir']</code>.";
Expand Down
8 changes: 4 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1282,9 +1282,9 @@ function ganglia_cache_metrics() {
}
// Set up for cluster summary
$context = "index_array";
include_once $conf['ganglia_dir'] . "/functions.php";
include_once $conf['ganglia_dir'] . "/ganglia.php";
include_once $conf['ganglia_dir'] . "/get_ganglia.php";
include_once $conf['gweb_root'] . "/functions.php";
include_once $conf['gweb_root'] . "/ganglia.php";
include_once $conf['gweb_root'] . "/get_ganglia.php";

foreach ( $index_array['cluster'] as $hostname => $elements ) {
$hosts[] = $hostname;
Expand Down Expand Up @@ -1431,7 +1431,7 @@ function retrieve_metrics_cache () {
}
// Set up for cluster summary
$context = "index_array";
include_once $conf['ganglia_dir'] . "/ganglia.php";
include_once $conf['gweb_root'] . "/ganglia.php";
Gmetad($conf['ganglia_ip'], $conf['ganglia_port']);

foreach ( $index_array['cluster'] as $hostname => $elements ) {
Expand Down
Loading

0 comments on commit e7413f4

Please sign in to comment.