jashmenn-poolparty-extensions 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -10,6 +10,21 @@
10
10
 
11
11
  = Available extensions
12
12
 
13
+ == bash_alias
14
+ Adds a bash alias
15
+
16
+ == development_gem_package
17
+ Deploy a and install a gem developed locally. This is useful when you are
18
+ developing an internal or forked gem and you want to deploy it to your cloud
19
+
20
+
21
+ == Usage
22
+
23
+ has_development_gem_package('jetty-rack',
24
+ :from => "~/path/to/my/site",
25
+ :git_pull_first => true) # git pull from before sending to server
26
+
27
+
13
28
  == dynomite
14
29
  Installs edge dynomite from the git repository
15
30
 
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ begin
8
8
  gem.summary = %Q{Extensions on to of poolparty}
9
9
  gem.email = "arilerner@mac.com"
10
10
  gem.homepage = "http://github.com/auser/poolparty-extensions"
11
- gem.authors = ["Ari Lerner"]
11
+ gem.authors = ["Ari Lerner, Nate Murray, & Michael Fairchild"]
12
12
 
13
13
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
14
  end
@@ -76,7 +76,7 @@ task :readme do
76
76
  footer =<<-EOF
77
77
  == Copyright
78
78
 
79
- Copyright (c) 2009 Ari Lerner. See LICENSE for details.
79
+ Copyright (c) 2009 Ari Lerner & Cloudteam. See LICENSE for details.
80
80
  EOF
81
81
 
82
82
  extensions = FileList["#{File.dirname(__FILE__)}/lib/extensions/*.rb"]
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 0
4
- :patch: 7
3
+ :minor: 1
4
+ :patch: 0
@@ -1,3 +1,6 @@
1
+ =begin rdoc
2
+ Adds a bash alias
3
+ =end
1
4
  module PoolParty
2
5
  module Plugin
3
6
  class BashAlias < Plugin
@@ -0,0 +1,78 @@
1
+ =begin rdoc
2
+
3
+ == Convenience Helpers
4
+
5
+ Adds a few handy packages and aliases for developing poolparty instances.
6
+
7
+ == Usage
8
+
9
+ has_convenience_helpers
10
+
11
+ == Examples
12
+
13
+ $ inspect-poolparty-recipes # => will vim the poolparty chef recipe file
14
+ $ cd-cookbooks # => cd into the poolparty cookbooks directory
15
+ $ tree # => show the directory structure as a nice tree
16
+ /var/poolparty/dr_configure/chef/cookbooks/poolparty# tree
17
+ .
18
+ |-- attributes
19
+ | `-- poolparty.rb
20
+ |-- recipes
21
+ | `-- default.rb
22
+ `-- templates
23
+ `-- default
24
+ |-- etc
25
+ | |-- jvm.erb
26
+ | `-- motd.erb
27
+ |-- home
28
+ | `-- hadoop
29
+ | `-- ssh
30
+ | `-- hadoop_id_rsa.erb
31
+ `-- usr
32
+ `-- local
33
+ `-- hadoop
34
+ `-- conf
35
+ |-- hadoop-env.sh.erb
36
+ `-- hadoop-site.xml.erb
37
+
38
+ =end
39
+
40
+ module PoolParty
41
+ module Plugin
42
+ class ConvenienceHelpers < Plugin
43
+ def before_load(o={}, &block)
44
+ add_packages
45
+ add_aliases
46
+ add_binaries
47
+ add_profile_updates
48
+ end
49
+
50
+ def add_packages
51
+ has_package "tree"
52
+ has_package "vim-nox"
53
+ has_package" screen"
54
+ has_package" irb"
55
+ end
56
+
57
+ def add_aliases
58
+ has_bash_alias :name => "inspect-poolparty-recipes", :value => "vi /var/poolparty/dr_configure/chef/cookbooks/poolparty/recipes/default.rb"
59
+ has_bash_alias :name => "cd-cookbooks", :value => "pushd /var/poolparty/dr_configure/chef/cookbooks/poolparty"
60
+ end
61
+
62
+ def add_binaries
63
+ has_exec "wget http://gist.github.com/raw/131294/0622454b2cc2f787c04d20ab3d47e888e31edcd4/gistfile1 -O /usr/bin/xtail && chmod +x /usr/bin/xtail",
64
+ :not_if => "test -e /usr/bin/xtail"
65
+ has_exec "curl timkay.com/aws/aws -o /usr/bin/aws", :not_if => "test -e /usr/bin/aws"
66
+ end
67
+
68
+ def add_profile_updates
69
+ has_exec %Q{echo \\"export PS1='\\\\u@\\\\h \\\\A \\\\w (#{cloud_name}) $ '\\" >> /root/.profile}, :not_if => "grep PS1 /root/.profile | grep #{cloud_name}"
70
+ # bind '"\e[A":history-search-backward'
71
+ # bind '"\e[B":history-search-forward'
72
+ end
73
+
74
+ end
75
+ end
76
+ end
77
+
78
+
@@ -1,5 +1,4 @@
1
- module PoolParty
2
- =begin rdoc
1
+ =begin rdoc
3
2
  == Development Gem
4
3
 
5
4
  Deploy a and install a gem developed locally. This is useful when you are
@@ -13,6 +12,8 @@ developing an internal or forked gem and you want to deploy it to your cloud
13
12
  :git_pull_first => true) # git pull from before sending to server
14
13
 
15
14
  =end
15
+
16
+ module PoolParty
16
17
  module Plugin
17
18
  class DevelopmentGem < Plugin
18
19
 
@@ -0,0 +1,173 @@
1
+ =begin rdoc
2
+
3
+ == Overview
4
+ Install Ganglia cloud monitoring system
5
+
6
+ == Requirements
7
+ You'll need apache and php enabled in your clouds.rb. For example:
8
+
9
+ apache do
10
+ enable_php5 do
11
+ extras :gd
12
+ end
13
+ end
14
+
15
+ Because the configs need to know about every node in the cloud *after* it has
16
+ launched, you must setup an after_all_loaded block in your clouds.rb that calls
17
+ ganglia.perform_after_all_loaded_for_master. For example:
18
+
19
+ after_all_loaded do
20
+ clouds[:hadoop_master].run_in_context do
21
+ ganglia.perform_after_all_loaded_for_master
22
+ end
23
+ end
24
+
25
+ Currently the tasks only need to be run for master, so simply call this on your
26
+ "master" cloud. Note: replace hadoop_master with the name of your cloud above.
27
+
28
+ == EC2 Firewall
29
+
30
+ ec2-authorize -P udp -p 8649 nmurray-hadoop
31
+ ec2-authorize -P tcp -p 8649 nmurray-hadoop
32
+
33
+ == References
34
+ * http://www.ibm.com/developerworks/wikis/display/WikiPtype/ganglia?decorator=printable
35
+ * http://docs.google.com/Doc?id=dgmmft5s_45hr7hmggr
36
+ * http://www.hps.com/~tpg/notebook/ganglia.php
37
+ * http://www.cultofgary.com/2008/10/16/ec2-and-ganglia/
38
+ =end
39
+
40
+ module PoolParty
41
+ module Plugin
42
+ class Ganglia < Plugin
43
+ def before_load(o={}, &block)
44
+ do_once do
45
+ install_dependencies
46
+ download
47
+ end
48
+ end
49
+
50
+ def install_dependencies
51
+ has_package :name => "rrdtool"
52
+ has_package :name => "build-essential"
53
+ has_package :name => "librrd-dev"
54
+ has_package :name => "libapr1-dev"
55
+ has_package :name => "libconfuse-dev"
56
+ has_package :name => "libexpat1-dev"
57
+ has_package :name => "python-dev"
58
+
59
+ has_group "ganglia", :action => :create
60
+ has_user "ganglia", :gid => "ganglia"
61
+
62
+ # libart-2.0-2 ?
63
+ end
64
+
65
+ def download
66
+ has_exec "wget http://superb-west.dl.sourceforge.net/sourceforge/ganglia/ganglia-3.1.2.tar.gz -O /usr/local/src/ganglia-3.1.2.tar.gz",
67
+ :not_if => "test -e /usr/local/src/ganglia-3.1.2.tar.gz"
68
+ has_exec "cd /usr/local/src && tar -xvvf /usr/local/src/ganglia-3.1.2.tar.gz",
69
+ :not_if => "test -e /usr/local/src/ganglia-3.1.2"
70
+ end
71
+
72
+ def master
73
+ has_exec "cd /usr/local/src/ganglia-3.1.2 && ./configure --with-gmetad && make && make install",
74
+ :not_if => "test -e /usr/lib/ganglia"
75
+ has_exec "mv /usr/local/src/ganglia-3.1.2/web /var/www/ganglia",
76
+ :not_if => "test -e /var/www/ganglia"
77
+ has_file :name => "/var/www/ganglia/conf.php", :mode => "0644", :template => "ganglia-web-conf.php.erb"
78
+ has_variable "ganglia_gmond_is_master", :value => true
79
+ gmond
80
+ gmetad
81
+ end
82
+
83
+ def slave
84
+ has_exec "cd /usr/local/src/ganglia-3.1.2 && ./configure && make && make install",
85
+ :not_if => "test -e /usr/lib/ganglia"
86
+ has_variable "ganglia_gmond_is_master", :value => false
87
+ gmond
88
+ end
89
+
90
+ def gmond
91
+ has_directory "/etc/ganglia"
92
+ has_exec({:name => "restart-gmond", :command => "/etc/init.d/gmond restart", :action => :nothing})
93
+
94
+ has_file(:name => "/etc/init.d/gmond") do
95
+ mode 0755
96
+ template :bin/"gmond.erb"
97
+ calls get_exec("restart-gmond")
98
+ end
99
+
100
+ end
101
+
102
+ def gmetad
103
+ has_directory "/var/lib/ganglia/rrds"
104
+ has_exec "chmod 755 /var/lib/ganglia/rrds"
105
+ has_exec "chown -R ganglia:ganglia /var/lib/ganglia/rrds"
106
+ has_exec({:name => "restart-gmetad", :command => "/etc/init.d/gmetad restart", :action => :nothing})
107
+ has_file(:name => "/etc/init.d/gmetad") do
108
+ mode 0755
109
+ template :bin/"gmetad.erb"
110
+ calls get_exec("restart-gmetad")
111
+ end
112
+ end
113
+
114
+ def monitor(*cloud_names)
115
+ @monitored_clouds = cloud_names
116
+ end
117
+
118
+ def perform_after_all_loaded_for_slave
119
+ gmond_after_all_loaded
120
+ end
121
+
122
+ def perform_after_all_loaded_for_master
123
+ raise "No clouds to monitor with ganglia specified. Please use the 'monitor(*cloud_names)' directive within your ganglia block" unless @monitored_clouds
124
+ gmond_after_all_loaded
125
+
126
+ data_sources = ""
127
+ @monitored_clouds.each do |cloud_name|
128
+ line = "data_source \\\"#{cloud_name}\\\" "
129
+ ips = []
130
+ clouds[cloud_name.intern].nodes(:status => 'running').each_with_index do |n, i|
131
+ ips << n[:private_dns_name] + ":8649"
132
+ end
133
+ data_sources << (line + ips.join(" ") + "\n")
134
+ end
135
+ data_sources.gsub!(/\n/, '\n')
136
+
137
+ has_variable "ganglia_gmetad_data_sources", :value => data_sources
138
+ has_file(:name => "/etc/ganglia/gmetad.conf") do
139
+ mode 0644
140
+ template "gmetad.conf.erb"
141
+ # calls get_exec("restart-gmetad")
142
+ end
143
+ has_service "gmetad", :enabled => true, :running => true, :supports => [:restart]
144
+ end
145
+
146
+ def gmond_after_all_loaded
147
+ has_variable "ganglia_cloud_name", :value => cloud_name
148
+ has_variable "ganglia_this_nodes_private_ip", :value => lambda{ %Q{%x[curl http://169.254.169.254/latest/meta-data/local-ipv4]}}
149
+ has_variable "ganglia_masters_ip", :value => lambda { %Q{\`ping -c1 master0 | grep PING | awk -F '[()]' '{print $2 }'\`.strip}}
150
+
151
+ first_node = clouds[cloud_name].nodes(:status => 'running').first
152
+
153
+ if first_node
154
+ has_variable "ganglia_first_node_in_clusters_ip", :value => lambda { %Q{\`ping -c1 #{first_node[:private_dns_name]} | grep PING | awk -F '[()]' '{print $2 }'\`.strip}}
155
+
156
+ has_file(:name => "/etc/ganglia/gmond.conf") do
157
+ mode 0644
158
+ template "gmond.conf.erb"
159
+ # calls get_exec("restart-gmond")
160
+ end
161
+ end
162
+ has_service "gmond", :enabled => true, :running => true, :supports => [:restart]
163
+
164
+ end
165
+
166
+ # todo, add a verifier
167
+ # telnet localhost 8649
168
+
169
+ end
170
+ end
171
+ end
172
+
173
+
@@ -0,0 +1,38 @@
1
+ #!/bin/sh
2
+
3
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
4
+ DAEMON=/usr/sbin/gmetad
5
+ NAME=gmetad
6
+ DESC="Ganglia Monitor Meta-Daemon"
7
+
8
+ test -x $DAEMON || exit 0
9
+ set -e
10
+
11
+ case "$1" in
12
+ start)
13
+ echo -n "Starting $DESC: "
14
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
15
+ --exec $DAEMON
16
+ echo "$NAME."
17
+ ;;
18
+ stop)
19
+ echo -n "Stopping $DESC: "
20
+ start-stop-daemon --stop --quiet --oknodo \
21
+ --exec $DAEMON 2>&1 > /dev/null
22
+ echo "$NAME."
23
+ ;;
24
+ reload)
25
+ ;;
26
+ restart|force-reload)
27
+ $0 stop
28
+ $0 start
29
+ ;;
30
+ *)
31
+ N=/etc/init.d/$NAME
32
+ # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
33
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
34
+ exit 1
35
+ ;;
36
+ esac
37
+
38
+ exit 0
@@ -0,0 +1,38 @@
1
+ #!/bin/sh
2
+
3
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
4
+ DAEMON=/usr/sbin/gmond
5
+ NAME=gmond
6
+ DESC="Ganglia Monitor Daemon"
7
+
8
+ test -x $DAEMON || exit 0
9
+ set -e
10
+
11
+ case "$1" in
12
+ start)
13
+ echo -n "Starting $DESC: "
14
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
15
+ --exec $DAEMON
16
+ echo "$NAME."
17
+ ;;
18
+ stop)
19
+ echo -n "Stopping $DESC: "
20
+ start-stop-daemon --stop --quiet --oknodo \
21
+ --exec $DAEMON 2>&1 > /dev/null
22
+ echo "$NAME."
23
+ ;;
24
+ reload)
25
+ ;;
26
+ restart|force-reload)
27
+ $0 stop
28
+ $0 start
29
+ ;;
30
+ *)
31
+ N=/etc/init.d/$NAME
32
+ # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
33
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
34
+ exit 1
35
+ ;;
36
+ esac
37
+
38
+ exit 0
@@ -0,0 +1,191 @@
1
+ <?php
2
+ # $Id: conf.php.in 1831 2008-09-26 12:18:54Z carenas $
3
+ #
4
+ # Gmetad-webfrontend version. Used to check for updates.
5
+ #
6
+ include_once "./version.php";
7
+
8
+ #
9
+ # The name of the directory in "./templates" which contains the
10
+ # templates that you want to use. Templates are like a skin for the
11
+ # site that can alter its look and feel.
12
+ #
13
+ $template_name = "default";
14
+
15
+ #
16
+ # If you installed gmetad in a directory other than the default
17
+ # make sure you change it here.
18
+ #
19
+
20
+ # Where gmetad stores the rrd archives.
21
+ $gmetad_root = "/var/lib/ganglia";
22
+ $rrds = "$gmetad_root/rrds";
23
+
24
+ # Leave this alone if rrdtool is installed in $gmetad_root,
25
+ # otherwise, change it if it is installed elsewhere (like /usr/bin)
26
+ define("RRDTOOL", "/usr/bin/rrdtool");
27
+
28
+ # Location for modular-graph files.
29
+ $graphdir='./graph.d';
30
+
31
+ #
32
+ # If you want to grab data from a different ganglia source specify it here.
33
+ # Although, it would be strange to alter the IP since the Round-Robin
34
+ # databases need to be local to be read.
35
+ #
36
+ $ganglia_ip = "127.0.0.1";
37
+ $ganglia_port = 8652;
38
+
39
+ #
40
+ # The maximum number of dynamic graphs to display. If you set this
41
+ # to 0 (the default) all graphs will be shown. This option is
42
+ # helpful if you are viewing the web pages from a browser with a
43
+ # small pipe.
44
+ #
45
+ $max_graphs = 0;
46
+
47
+ #
48
+ # In the Cluster View this sets the default number of columns used to
49
+ # display the host grid below the summary graphs.
50
+ #
51
+ $hostcols = 4;
52
+
53
+ #
54
+ # In the Host View this sets the default number of columns used to
55
+ # display the metric grid below the summary graphs.
56
+ #
57
+ $metriccols = 2;
58
+
59
+ #
60
+ # Turn on and off the Grid Snapshot. Now that we have a
61
+ # hierarchical snapshot (per-cluster instead of per-node) on
62
+ # the meta page this makes more sense. Most people will want this
63
+ # on.
64
+ #
65
+ $show_meta_snapshot = "yes";
66
+
67
+ #
68
+ # The default refresh frequency on pages.
69
+ #
70
+ $default_refresh = 300;
71
+
72
+ #
73
+ # Colors for the CPU report graph
74
+ #
75
+ $cpu_user_color = "3333bb";
76
+ $cpu_nice_color = "ffea00";
77
+ $cpu_system_color = "dd0000";
78
+ $cpu_wio_color = "ff8a60";
79
+ $cpu_idle_color = "e2e2f2";
80
+
81
+ #
82
+ # Colors for the MEMORY report graph
83
+ #
84
+ $mem_used_color = "5555cc";
85
+ $mem_shared_color = "0000aa";
86
+ $mem_cached_color = "33cc33";
87
+ $mem_buffered_color = "99ff33";
88
+ $mem_free_color = "00ff00";
89
+ $mem_swapped_color = "9900CC";
90
+
91
+ #
92
+ # Colors for the LOAD report graph
93
+ #
94
+ $load_one_color = "CCCCCC";
95
+ $proc_run_color = "0000FF";
96
+ $cpu_num_color = "FF0000";
97
+ $num_nodes_color = "00FF00";
98
+
99
+ # Other colors
100
+ $jobstart_color = "ff3300";
101
+
102
+ #
103
+ # Colors for the load ranks.
104
+ #
105
+ $load_colors = array(
106
+ "100+" => "ff634f",
107
+ "75-100" =>"ffa15e",
108
+ "50-75" => "ffde5e",
109
+ "25-50" => "caff98",
110
+ "0-25" => "e2ecff",
111
+ "down" => "515151"
112
+ );
113
+
114
+ #
115
+ # Load scaling
116
+ #
117
+ $load_scale = 1.0;
118
+
119
+ #
120
+ # Default color for single metric graphs
121
+ #
122
+ $default_metric_color = "555555";
123
+
124
+ #
125
+ # Default metric
126
+ #
127
+ $default_metric = "load_one";
128
+
129
+ #
130
+ # remove the domainname from the FQDN hostnames in graphs
131
+ # (to help with long hostnames in small charts)
132
+ #
133
+ $strip_domainname = false;
134
+
135
+ #
136
+ # Optional summary graphs
137
+ #
138
+ #$optional_graphs = array('packet');
139
+
140
+ #
141
+ # Time ranges
142
+ # Each value is the # of seconds in that range.
143
+ #
144
+ $time_ranges = array(
145
+ 'hour'=>3600,
146
+ 'day'=>86400,
147
+ 'week'=>604800,
148
+ 'month'=>2419200,
149
+ 'year'=>31449600
150
+ );
151
+
152
+ # this key must exist in $time_ranges
153
+ $default_time_range = 'hour';
154
+
155
+ #
156
+ # Graph sizes
157
+ #
158
+ $graph_sizes = array(
159
+ 'small'=>array(
160
+ 'height'=>40,
161
+ 'width'=>130,
162
+ 'fudge_0'=>0,
163
+ 'fudge_1'=>0,
164
+ 'fudge_2'=>0
165
+ ),
166
+ 'medium'=>array(
167
+ 'height'=>75,
168
+ 'width'=>300,
169
+ 'fudge_0'=>0,
170
+ 'fudge_1'=>14,
171
+ 'fudge_2'=>28
172
+ ),
173
+ 'large'=>array(
174
+ 'height'=>600,
175
+ 'width'=>800,
176
+ 'fudge_0'=>0,
177
+ 'fudge_1'=>0,
178
+ 'fudge_2'=>0
179
+ ),
180
+ # this was the default value when no other size was provided.
181
+ 'default'=>array(
182
+ 'height'=>100,
183
+ 'width'=>400,
184
+ 'fudge_0'=>0,
185
+ 'fudge_1'=>0,
186
+ 'fudge_2'=>0
187
+ )
188
+ );
189
+ $default_graph_size = 'default';
190
+ $graph_sizes_keys = array_keys( $graph_sizes );
191
+ ?>
@@ -0,0 +1,115 @@
1
+ # This is an example of a Ganglia Meta Daemon configuration file
2
+ # http://ganglia.sourceforge.net/
3
+ #
4
+ # $Id: gmetad.conf.in 1639 2008-08-09 23:30:32Z carenas $
5
+ #
6
+ #-------------------------------------------------------------------------------
7
+ # Setting the debug_level to 1 will keep daemon in the forground and
8
+ # show only error messages. Setting this value higher than 1 will make
9
+ # gmetad output debugging information and stay in the foreground.
10
+ # default: 0
11
+ # debug_level 10
12
+ #
13
+ #-------------------------------------------------------------------------------
14
+ # What to monitor. The most important section of this file.
15
+ #
16
+ # The data_source tag specifies either a cluster or a grid to
17
+ # monitor. If we detect the source is a cluster, we will maintain a complete
18
+ # set of RRD databases for it, which can be used to create historical
19
+ # graphs of the metrics. If the source is a grid (it comes from another gmetad),
20
+ # we will only maintain summary RRDs for it.
21
+ #
22
+ # Format:
23
+ # data_source "my cluster" [polling interval] address1:port addreses2:port ...
24
+ #
25
+ # The keyword 'data_source' must immediately be followed by a unique
26
+ # string which identifies the source, then an optional polling interval in
27
+ # seconds. The source will be polled at this interval on average.
28
+ # If the polling interval is omitted, 15sec is asssumed.
29
+ #
30
+ # A list of machines which service the data source follows, in the
31
+ # format ip:port, or name:port. If a port is not specified then 8649
32
+ # (the default gmond port) is assumed.
33
+ # default: There is no default value
34
+ #
35
+ # data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655
36
+ # data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651
37
+ # data_source "another source" 1.3.4.7:8655 1.3.4.8
38
+ # data_source "my cluster" localhost
39
+ #
40
+ <%= @node[:poolparty][:ganglia_gmetad_data_sources] %>
41
+
42
+ #
43
+ # Round-Robin Archives
44
+ # You can specify custom Round-Robin archives here (defaults are listed below)
45
+ #
46
+ # 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" \
47
+ # "RRA:AVERAGE:0.5:5760:374"
48
+ #
49
+
50
+ #
51
+ #-------------------------------------------------------------------------------
52
+ # Scalability mode. If on, we summarize over downstream grids, and respect
53
+ # authority tags. If off, we take on 2.5.0-era behavior: we do not wrap our output
54
+ # in <GRID></GRID> tags, we ignore all <GRID> tags we see, and always assume
55
+ # we are the "authority" on data source feeds. This approach does not scale to
56
+ # large groups of clusters, but is provided for backwards compatibility.
57
+ # default: on
58
+ # scalable off
59
+ #
60
+ #-------------------------------------------------------------------------------
61
+ # The name of this Grid. All the data sources above will be wrapped in a GRID
62
+ # tag with this name.
63
+ # default: unspecified
64
+ # gridname "MyGrid"
65
+ #
66
+ #-------------------------------------------------------------------------------
67
+ # The authority URL for this grid. Used by other gmetads to locate graphs
68
+ # for our data sources. Generally points to a ganglia/
69
+ # website on this machine.
70
+ # default: "http://hostname/ganglia/",
71
+ # where hostname is the name of this machine, as defined by gethostname().
72
+ # authority "http://mycluster.org/newprefix/"
73
+ #
74
+ #-------------------------------------------------------------------------------
75
+ # List of machines this gmetad will share XML with. Localhost
76
+ # is always trusted.
77
+ # default: There is no default value
78
+ # trusted_hosts 127.0.0.1 169.229.50.165 my.gmetad.org
79
+ #
80
+ #-------------------------------------------------------------------------------
81
+ # If you want any host which connects to the gmetad XML to receive
82
+ # data, then set this value to "on"
83
+ # default: off
84
+ # all_trusted on
85
+ #
86
+ #-------------------------------------------------------------------------------
87
+ # If you don't want gmetad to setuid then set this to off
88
+ # default: on
89
+ # setuid off
90
+ #
91
+ #-------------------------------------------------------------------------------
92
+ # User gmetad will setuid to (defaults to "nobody")
93
+ # default: "nobody"
94
+ setuid_username "ganglia"
95
+ #
96
+ #-------------------------------------------------------------------------------
97
+ # The port gmetad will answer requests for XML
98
+ # default: 8651
99
+ # xml_port 8651
100
+ #
101
+ #-------------------------------------------------------------------------------
102
+ # The port gmetad will answer queries for XML. This facility allows
103
+ # simple subtree and summation views of the XML tree.
104
+ # default: 8652
105
+ interactive_port 8652
106
+ #
107
+ #-------------------------------------------------------------------------------
108
+ # The number of threads answering XML requests
109
+ # default: 4
110
+ # server_threads 10
111
+ #
112
+ #-------------------------------------------------------------------------------
113
+ # Where gmetad stores its round-robin databases
114
+ # default: "/var/lib/ganglia/rrds"
115
+ # rrd_rootdir "/some/other/place"
@@ -0,0 +1,362 @@
1
+ /* This configuration is as close to 2.5.x default behavior as possible
2
+ The values closely match ./gmond/metric.h definitions in 2.5.x */
3
+ globals {
4
+ daemonize = yes
5
+ setuid = yes
6
+ user = ganglia
7
+ debug_level = 0
8
+ max_udp_msg_len = 1472
9
+ mute = no
10
+ deaf = no
11
+ allow_extra_data = yes
12
+ host_dmax = 0 /*secs */
13
+ cleanup_threshold = 300 /*secs */
14
+ gexec = no
15
+ send_metadata_interval = 10
16
+ }
17
+
18
+ /*
19
+ * The cluster attributes specified will be used as part of the <CLUSTER>
20
+ * tag that will wrap all hosts collected by this instance.
21
+ */
22
+ cluster {
23
+ name = "<%= @node[:poolparty][:ganglia_cloud_name] %>"
24
+ owner = "unspecified"
25
+ latlong = "unspecified"
26
+ url = "unspecified"
27
+ }
28
+
29
+ /* The host section describes attributes of the host, like the location */
30
+ host {
31
+ location = "unspecified"
32
+ }
33
+
34
+ /* Feel free to specify as many udp_send_channels as you like. Gmond
35
+ used to only support having a single channel */
36
+ udp_send_channel {
37
+ /* mcast_join = <%= @node[:poolparty][:ganglia_masters_ip] %> */
38
+ /* host = <%= @node[:poolparty][:ganglia_masters_ip] %> */
39
+ host = <%= @node[:poolparty][:ganglia_first_node_in_clusters_ip] %>
40
+ port = 8649
41
+ ttl = 1
42
+ }
43
+
44
+ /* You can specify as many udp_recv_channels as you like as well. */
45
+ udp_recv_channel {
46
+ /* mcast_join = <%= @node[:poolparty][:ganglia_this_nodes_private_ip] %> */
47
+ port = 8649
48
+ bind = <%= @node[:poolparty][:ganglia_this_nodes_private_ip] %>
49
+ /* bind = 0.0.0.0 */
50
+ family = inet4
51
+
52
+ acl {
53
+ default = "allow"
54
+ }
55
+ }
56
+
57
+ <%# if @node[:poolparty][:ganglia_gmond_is_master] %>
58
+ <%# end %>
59
+
60
+ /* You can specify as many tcp_accept_channels as you like to share
61
+ an xml description of the state of the cluster */
62
+ tcp_accept_channel {
63
+ port = 8649
64
+ bind = <%= @node[:poolparty][:ganglia_this_nodes_private_ip] %>
65
+
66
+ acl {
67
+ default = "allow"
68
+ }
69
+
70
+ }
71
+
72
+
73
+ /* Each metrics module that is referenced by gmond must be specified and
74
+ loaded. If the module has been statically linked with gmond, it does
75
+ not require a load path. However all dynamically loadable modules must
76
+ include a load path. */
77
+ modules {
78
+ module {
79
+ name = "core_metrics"
80
+ }
81
+ module {
82
+ name = "cpu_module"
83
+ path = "modcpu.so"
84
+ }
85
+ module {
86
+ name = "disk_module"
87
+ path = "moddisk.so"
88
+ }
89
+ module {
90
+ name = "load_module"
91
+ path = "modload.so"
92
+ }
93
+ module {
94
+ name = "mem_module"
95
+ path = "modmem.so"
96
+ }
97
+ module {
98
+ name = "net_module"
99
+ path = "modnet.so"
100
+ }
101
+ module {
102
+ name = "proc_module"
103
+ path = "modproc.so"
104
+ }
105
+ module {
106
+ name = "sys_module"
107
+ path = "modsys.so"
108
+ }
109
+ }
110
+
111
+ include ('/etc/ganglia/conf.d/*.conf')
112
+
113
+ /* The old internal 2.5.x metric array has been replaced by the following
114
+ collection_group directives. What follows is the default behavior for
115
+ collecting and sending metrics that is as close to 2.5.x behavior as
116
+ possible. */
117
+
118
+ /* This collection group will cause a heartbeat (or beacon) to be sent every
119
+ 20 seconds. In the heartbeat is the GMOND_STARTED data which expresses
120
+ the age of the running gmond. */
121
+ collection_group {
122
+ collect_once = yes
123
+ time_threshold = 20
124
+ metric {
125
+ name = "heartbeat"
126
+ }
127
+ }
128
+
129
+ /* This collection group will send general info about this host every
130
+ 1200 secs.
131
+ This information doesn't change between reboots and is only collected
132
+ once. */
133
+ collection_group {
134
+ collect_once = yes
135
+ time_threshold = 1200
136
+ metric {
137
+ name = "cpu_num"
138
+ title = "CPU Count"
139
+ }
140
+ metric {
141
+ name = "cpu_speed"
142
+ title = "CPU Speed"
143
+ }
144
+ metric {
145
+ name = "mem_total"
146
+ title = "Memory Total"
147
+ }
148
+ /* Should this be here? Swap can be added/removed between reboots. */
149
+ metric {
150
+ name = "swap_total"
151
+ title = "Swap Space Total"
152
+ }
153
+ metric {
154
+ name = "boottime"
155
+ title = "Last Boot Time"
156
+ }
157
+ metric {
158
+ name = "machine_type"
159
+ title = "Machine Type"
160
+ }
161
+ metric {
162
+ name = "os_name"
163
+ title = "Operating System"
164
+ }
165
+ metric {
166
+ name = "os_release"
167
+ title = "Operating System Release"
168
+ }
169
+ metric {
170
+ name = "location"
171
+ title = "Location"
172
+ }
173
+ }
174
+
175
+ /* This collection group will send the status of gexecd for this host
176
+ every 300 secs.*/
177
+ /* Unlike 2.5.x the default behavior is to report gexecd OFF. */
178
+ collection_group {
179
+ collect_once = yes
180
+ time_threshold = 300
181
+ metric {
182
+ name = "gexec"
183
+ title = "Gexec Status"
184
+ }
185
+ }
186
+
187
+ /* This collection group will collect the CPU status info every 20 secs.
188
+ The time threshold is set to 90 seconds. In honesty, this
189
+ time_threshold could be set significantly higher to reduce
190
+ unneccessary network chatter. */
191
+ collection_group {
192
+ collect_every = 20
193
+ time_threshold = 90
194
+ /* CPU status */
195
+ metric {
196
+ name = "cpu_user"
197
+ value_threshold = "1.0"
198
+ title = "CPU User"
199
+ }
200
+ metric {
201
+ name = "cpu_system"
202
+ value_threshold = "1.0"
203
+ title = "CPU System"
204
+ }
205
+ metric {
206
+ name = "cpu_idle"
207
+ value_threshold = "5.0"
208
+ title = "CPU Idle"
209
+ }
210
+ metric {
211
+ name = "cpu_nice"
212
+ value_threshold = "1.0"
213
+ title = "CPU Nice"
214
+ }
215
+ metric {
216
+ name = "cpu_aidle"
217
+ value_threshold = "5.0"
218
+ title = "CPU aidle"
219
+ }
220
+ metric {
221
+ name = "cpu_wio"
222
+ value_threshold = "1.0"
223
+ title = "CPU wio"
224
+ }
225
+ /* The next two metrics are optional if you want more detail...
226
+ ... since they are accounted for in cpu_system.
227
+ metric {
228
+ name = "cpu_intr"
229
+ value_threshold = "1.0"
230
+ title = "CPU intr"
231
+ }
232
+ metric {
233
+ name = "cpu_sintr"
234
+ value_threshold = "1.0"
235
+ title = "CPU sintr"
236
+ }
237
+ */
238
+ }
239
+
240
+ collection_group {
241
+ collect_every = 20
242
+ time_threshold = 90
243
+ /* Load Averages */
244
+ metric {
245
+ name = "load_one"
246
+ value_threshold = "1.0"
247
+ title = "One Minute Load Average"
248
+ }
249
+ metric {
250
+ name = "load_five"
251
+ value_threshold = "1.0"
252
+ title = "Five Minute Load Average"
253
+ }
254
+ metric {
255
+ name = "load_fifteen"
256
+ value_threshold = "1.0"
257
+ title = "Fifteen Minute Load Average"
258
+ }
259
+ }
260
+
261
+ /* This group collects the number of running and total processes */
262
+ collection_group {
263
+ collect_every = 80
264
+ time_threshold = 950
265
+ metric {
266
+ name = "proc_run"
267
+ value_threshold = "1.0"
268
+ title = "Total Running Processes"
269
+ }
270
+ metric {
271
+ name = "proc_total"
272
+ value_threshold = "1.0"
273
+ title = "Total Processes"
274
+ }
275
+ }
276
+
277
+ /* This collection group grabs the volatile memory metrics every 40 secs and
278
+ sends them at least every 180 secs. This time_threshold can be increased
279
+ significantly to reduce unneeded network traffic. */
280
+ collection_group {
281
+ collect_every = 40
282
+ time_threshold = 180
283
+ metric {
284
+ name = "mem_free"
285
+ value_threshold = "1024.0"
286
+ title = "Free Memory"
287
+ }
288
+ metric {
289
+ name = "mem_shared"
290
+ value_threshold = "1024.0"
291
+ title = "Shared Memory"
292
+ }
293
+ metric {
294
+ name = "mem_buffers"
295
+ value_threshold = "1024.0"
296
+ title = "Memory Buffers"
297
+ }
298
+ metric {
299
+ name = "mem_cached"
300
+ value_threshold = "1024.0"
301
+ title = "Cached Memory"
302
+ }
303
+ metric {
304
+ name = "swap_free"
305
+ value_threshold = "1024.0"
306
+ title = "Free Swap Space"
307
+ }
308
+ }
309
+
310
+ collection_group {
311
+ collect_every = 40
312
+ time_threshold = 300
313
+ metric {
314
+ name = "bytes_out"
315
+ value_threshold = 4096
316
+ title = "Bytes Sent"
317
+ }
318
+ metric {
319
+ name = "bytes_in"
320
+ value_threshold = 4096
321
+ title = "Bytes Received"
322
+ }
323
+ metric {
324
+ name = "pkts_in"
325
+ value_threshold = 256
326
+ title = "Packets Received"
327
+ }
328
+ metric {
329
+ name = "pkts_out"
330
+ value_threshold = 256
331
+ title = "Packets Sent"
332
+ }
333
+ }
334
+
335
+ /* Different than 2.5.x default since the old config made no sense */
336
+ collection_group {
337
+ collect_every = 1800
338
+ time_threshold = 3600
339
+ metric {
340
+ name = "disk_total"
341
+ value_threshold = 1.0
342
+ title = "Total Disk Space"
343
+ }
344
+ }
345
+
346
+ collection_group {
347
+ collect_every = 40
348
+ time_threshold = 180
349
+ metric {
350
+ name = "disk_free"
351
+ value_threshold = 1.0
352
+ title = "Disk Space Available"
353
+ }
354
+ metric {
355
+ name = "part_max_used"
356
+ value_threshold = 1.0
357
+ title = "Maximum Disk Space Used"
358
+ }
359
+ }
360
+
361
+
362
+ # vim: ft=javascript
@@ -1,6 +1,9 @@
1
1
  class PoolpartyExtensions
2
2
  end
3
3
 
4
- Dir["#{File.dirname(__FILE__)}/extensions/*"].each do |lib|
5
- require lib
4
+ ["#{File.dirname(__FILE__)}/extensions/*.rb", "#{File.dirname(__FILE__)}/extensions/*/*.rb"].each do |dir|
5
+ Dir[dir].each do |lib|
6
+ PoolParty::Resources::File.add_searchable_path(File.dirname(lib)) if File.exists?(File.dirname(lib) + "/templates")
7
+ require lib if ::File.stat(lib).file?
8
+ end
6
9
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jashmenn-poolparty-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Ari Lerner
7
+ - Ari Lerner, Nate Murray, & Michael Fairchild
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-16 00:00:00 -07:00
12
+ date: 2009-06-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -28,8 +28,15 @@ files:
28
28
  - Rakefile
29
29
  - VERSION.yml
30
30
  - lib/extensions/bash_alias.rb
31
+ - lib/extensions/convenience_helpers.rb
31
32
  - lib/extensions/development_gem_package.rb
32
33
  - lib/extensions/dynomite.rb
34
+ - lib/extensions/ganglia/ganglia.rb
35
+ - lib/extensions/ganglia/templates/bin/gmetad.erb
36
+ - lib/extensions/ganglia/templates/bin/gmond.erb
37
+ - lib/extensions/ganglia/templates/ganglia-web-conf.php.erb
38
+ - lib/extensions/ganglia/templates/gmetad.conf.erb
39
+ - lib/extensions/ganglia/templates/gmond.conf.erb
33
40
  - lib/extensions/lightcloud.rb
34
41
  - lib/extensions/nanite.rb
35
42
  - lib/extensions/tokyo_tyrant.rb