fairchild-poolparty 1.3.5 → 1.3.17
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/bin/cloud +1 -0
- data/bin/cloud-compile +1 -0
- data/bin/cloud-misc +34 -0
- data/bin/cloud-show +13 -1
- data/bin/cloud-ssh +4 -1
- data/bin/cloud-thrift +32 -18
- data/config/jeweler.rb +5 -3
- data/examples/monitored_cloud.rb +1 -1
- data/examples/thrift/thrift_example.rb +8 -4
- data/examples/vmware.rb +10 -0
- data/lib/cloud_providers/cloud_provider.rb +9 -0
- data/lib/cloud_providers/cloud_provider_instance.rb +9 -4
- data/lib/cloud_providers/connections.rb +9 -5
- data/lib/cloud_providers/ec2/ec2.rb +42 -12
- data/lib/cloud_providers/ec2/ec2_helpers.rb +62 -5
- data/lib/cloud_providers/ec2/ec2_instance.rb +14 -1
- data/lib/cloud_providers/vmware/vmware.rb +3 -0
- data/lib/core/file.rb +12 -0
- data/lib/core/object.rb +1 -1
- data/lib/dependency_resolvers/base.rb +2 -9
- data/lib/dependency_resolvers/chef.rb +3 -3
- data/lib/keypair.rb +5 -3
- data/lib/poolparty.rb +3 -1
- data/lib/poolparty/base.rb +45 -22
- data/lib/poolparty/cloud.rb +70 -15
- data/lib/poolparty/default.rb +1 -0
- data/lib/poolparty/installer.rb +1 -1
- data/lib/poolparty/installers/ec2.rb +30 -16
- data/lib/poolparty/monitor.rb +25 -3
- data/lib/poolparty/plugin.rb +1 -5
- data/lib/poolparty/plugins/apache.rb +37 -11
- data/lib/poolparty/plugins/apache2/passenger_site.rb +1 -1
- data/lib/poolparty/plugins/apache2/virtual_host.rb +1 -0
- data/lib/poolparty/plugins/collectd.rb +29 -0
- data/lib/poolparty/plugins/collectd/templates/collectd.conf.erb +369 -0
- data/lib/poolparty/plugins/hermes.rb +101 -0
- data/lib/poolparty/pool.rb +14 -6
- data/lib/poolparty/resource.rb +20 -17
- data/lib/poolparty/resources/file.rb +2 -2
- data/lib/poolparty/resources/line.rb +1 -1
- data/lib/poolparty/resources/link.rb +2 -1
- data/lib/proto/command_interface_handler.rb +42 -7
- data/lib/proto/command_query_handler.rb +19 -0
- data/lib/proto/gen-py/cloudthrift/CommandInterface.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/__init__.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/constants.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/ttypes.pyc +0 -0
- data/lib/proto/gen-py/thrift/Thrift.pyc +0 -0
- data/lib/proto/gen-py/thrift/__init__.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/TBinaryProtocol.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/TProtocol.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/__init__.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/TSocket.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/TTransport.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/__init__.pyc +0 -0
- data/lib/proto/poolparty.thrift +1 -0
- data/tasks/poolparty.rake +24 -0
- data/test/fixtures/clouds/fake_clouds.rb +2 -2
- data/test/fixtures/clouds/simple_cloud.rb +2 -2
- data/test/fixtures/resources/fake_plugin.rb +5 -0
- data/test/fixtures/resources/fake_subclassed_plugin.rb +19 -0
- data/test/lib/cloud_providers/ec2/ec2_instance_test.rb +17 -8
- data/test/lib/cloud_providers/ec2/ec2_test.rb +15 -11
- data/test/lib/core/array_test.rb +4 -0
- data/test/lib/dependency_resolvers/base_test.rb +1 -1
- data/test/lib/dependency_resolvers/chef/resources/remote_directory_test.rb +2 -2
- data/test/lib/dependency_resolvers/chef/resources/remote_file_test.rb +1 -1
- data/test/lib/dependency_resolvers/chef_test.rb +3 -3
- data/test/lib/poolparty/base_test.rb +1 -1
- data/test/lib/poolparty/cloud_test.rb +140 -33
- data/test/lib/poolparty/monitor_test.rb +29 -2
- data/test/lib/poolparty/plugins/apache_test.rb +5 -0
- data/test/lib/poolparty/pool_test.rb +3 -3
- data/test/lib/poolparty/resource_test.rb +14 -2
- data/test/lib/poolparty/resources/conditional_test.rb +1 -0
- data/test/lib/poolparty/resources/directory_test.rb +1 -1
- data/test/lib/poolparty/resources/file_test.rb +1 -1
- data/test/lib/poolparty/resources/user_test.rb +1 -1
- data/test/lib/proto/command_query_handler_test.rb +11 -0
- data/test/lib/provision/bootstrapper_test.rb +0 -25
- data/test/test_helper.rb +0 -1
- metadata +15 -4
data/lib/poolparty/default.rb
CHANGED
data/lib/poolparty/installer.rb
CHANGED
@@ -2,9 +2,11 @@ module PoolParty
|
|
2
2
|
module Installers
|
3
3
|
class Ec2 < Installer
|
4
4
|
|
5
|
+
attr_reader :access_key, :secret_access_key, :ec2_directory
|
6
|
+
|
5
7
|
def steps
|
6
8
|
[
|
7
|
-
:
|
9
|
+
:check_for_access_keys,
|
8
10
|
:show_env_setup
|
9
11
|
]
|
10
12
|
end
|
@@ -17,18 +19,30 @@ module PoolParty
|
|
17
19
|
"Ec2 installer"
|
18
20
|
end
|
19
21
|
|
20
|
-
def
|
21
|
-
msg = "
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def check_for_access_keys
|
23
|
+
msg = "
|
24
|
+
I've detected the following for your ec2 setup.
|
25
|
+
<line>
|
26
|
+
access key: #{CloudProviders::Ec2.default_access_key}
|
27
|
+
secret access key: #{CloudProviders::Ec2.default_secret_access_key}
|
28
|
+
certificate: #{CloudProviders::Ec2.default_cert}
|
29
|
+
private key: #{CloudProviders::Ec2.default_private_key}
|
30
|
+
|
31
|
+
<yellow>Are these values correct?</yellow>
|
32
|
+
"
|
33
|
+
v = choose msg, %W(Yes No)
|
34
|
+
if v == "Yes"
|
35
|
+
puts "Using the values above"
|
36
|
+
@access_key = CloudProviders::Ec2.default_access_key
|
37
|
+
@secret_access_key = CloudProviders::Ec2.default_secret_access_key
|
38
|
+
@ec2_directory = File.dirname(CloudProviders::Ec2.default_cert)
|
39
|
+
else
|
40
|
+
[
|
41
|
+
:ask_for_ec2_directory, :ask_for_access_key, :ask_for_private_access_key
|
42
|
+
].each {|meth| self.send meth}
|
26
43
|
end
|
27
|
-
|
28
|
-
base = choose(msg, directories)
|
29
|
-
@ec2_directory = base == :other ? ask_for_ec2_directory : base
|
30
44
|
end
|
31
|
-
|
45
|
+
|
32
46
|
def ask_for_access_key
|
33
47
|
access_key_help =<<-EOV
|
34
48
|
EC2 uses an access key to identify you and allows you to start and stop instances.
|
@@ -37,7 +51,7 @@ EC2 uses an access key to identify you and allows you to start and stop instance
|
|
37
51
|
access_key = <<-EOE
|
38
52
|
What is your access key?
|
39
53
|
EOE
|
40
|
-
ask_with_help :message => access_key, :help => access_key_help do |k|
|
54
|
+
ask_with_help :message => access_key, :no_value => true, :help => access_key_help do |k|
|
41
55
|
@access_key = k
|
42
56
|
end
|
43
57
|
end
|
@@ -74,11 +88,11 @@ What's path to your ec2 directory with your cert and pk files?
|
|
74
88
|
|
75
89
|
Setup your environment:
|
76
90
|
|
77
|
-
export EC2_ACCESS_KEY=#{
|
78
|
-
export EC2_SECRET_KEY=#{
|
91
|
+
export EC2_ACCESS_KEY=#{access_key}
|
92
|
+
export EC2_SECRET_KEY=#{secret_access_key}
|
79
93
|
|
80
|
-
export EC2_PRIVATE_KEY=$(ls #{
|
81
|
-
export EC2_CERT=$(ls #{
|
94
|
+
export EC2_PRIVATE_KEY=$(ls #{ec2_directory}/pk-*.pem)
|
95
|
+
export EC2_CERT=$(ls #{ec2_directory}/cert-*.pem)
|
82
96
|
|
83
97
|
<line>
|
84
98
|
EOE
|
data/lib/poolparty/monitor.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
module PoolParty
|
16
16
|
class Monitor
|
17
17
|
|
18
|
-
attr_reader :name, :monitor_block
|
18
|
+
attr_reader :name, :monitor_block, :value_format
|
19
19
|
|
20
20
|
def initialize(monitor_name, &block)
|
21
21
|
msg =<<-EOE
|
@@ -27,7 +27,7 @@ You must pass a block with your monitor
|
|
27
27
|
end
|
28
28
|
EOE
|
29
29
|
raise PoolPartyError.create("MonitorDefinitionError", msg) unless block
|
30
|
-
@name = monitor_name
|
30
|
+
@name = monitor_name.to_sym
|
31
31
|
@monitor_block = block
|
32
32
|
end
|
33
33
|
|
@@ -37,11 +37,33 @@ You must pass a block with your monitor
|
|
37
37
|
# retrieved and return the methods available.
|
38
38
|
def run(val)
|
39
39
|
@methods = nil
|
40
|
-
instance_exec val, &monitor_block
|
40
|
+
instance_exec format_value(val), &monitor_block
|
41
41
|
methods
|
42
42
|
end
|
43
43
|
|
44
|
+
# Format the monitor values
|
45
|
+
# Set the monitor format here.
|
46
|
+
# The default will be to turn the value into a float
|
47
|
+
# but to allow other formats, call the value here, for instance:
|
48
|
+
# mon.format :to_s
|
49
|
+
# Blocks are also permitted
|
50
|
+
def format(meth=nil, &block)
|
51
|
+
@value_format ||= (meth ? meth : block)
|
52
|
+
end
|
53
|
+
|
44
54
|
private
|
55
|
+
|
56
|
+
# Format the value of the monitor
|
57
|
+
def format_value(value)
|
58
|
+
case value_format
|
59
|
+
when Proc
|
60
|
+
value_format.call(value)
|
61
|
+
when nil
|
62
|
+
value.to_f
|
63
|
+
else
|
64
|
+
value.send value_format
|
65
|
+
end
|
66
|
+
end
|
45
67
|
|
46
68
|
# We don't want the methods actually executing since we are executing the methods
|
47
69
|
# in a cloud, we just want to store the output values of the
|
data/lib/poolparty/plugin.rb
CHANGED
@@ -2,11 +2,7 @@
|
|
2
2
|
Simply a stub class for documentation purposes
|
3
3
|
Plugins are all resources
|
4
4
|
=end
|
5
|
-
module PoolParty
|
6
|
-
class Plugin
|
7
|
-
end
|
8
|
-
end
|
9
5
|
|
10
|
-
%w(apache git rails).each do |plugin|
|
6
|
+
%w(apache git rails collectd hermes).each do |plugin|
|
11
7
|
require "plugins/#{plugin}"
|
12
8
|
end
|
@@ -7,7 +7,12 @@ module PoolParty
|
|
7
7
|
default_options :port => 80,
|
8
8
|
:www_user => 'www-data',
|
9
9
|
:www_dir => "/var/www",
|
10
|
-
:passenger_version => "2.2.
|
10
|
+
:passenger_version => "2.2.5"
|
11
|
+
|
12
|
+
|
13
|
+
def name
|
14
|
+
"apache"
|
15
|
+
end
|
11
16
|
|
12
17
|
def before_load
|
13
18
|
installed_as_worker
|
@@ -39,6 +44,13 @@ module PoolParty
|
|
39
44
|
def install_passenger
|
40
45
|
enable_passenger
|
41
46
|
end
|
47
|
+
|
48
|
+
|
49
|
+
# LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
|
50
|
+
# PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
|
51
|
+
# PassengerRuby /usr/bin/ruby1.8
|
52
|
+
#
|
53
|
+
# creating this thing below may not be being run b/c it checks for the passenger.conf which isn't really a good test
|
42
54
|
|
43
55
|
def enable_passenger
|
44
56
|
unless @enable_passenger
|
@@ -46,7 +58,7 @@ module PoolParty
|
|
46
58
|
has_package "build-essential"
|
47
59
|
has_package "apache2-prefork-dev"
|
48
60
|
has_gem_package "fastthread"
|
49
|
-
has_gem_package "passenger"
|
61
|
+
has_gem_package "passenger", :version => passenger_version
|
50
62
|
passenger_configs
|
51
63
|
|
52
64
|
has_exec "install_passenger_script" do
|
@@ -55,8 +67,8 @@ module PoolParty
|
|
55
67
|
requires get_exec("restart-apache2")
|
56
68
|
requires get_package("apache2")
|
57
69
|
requires get_gem_package("passenger")
|
58
|
-
not_if "test -
|
59
|
-
creates lambda { "
|
70
|
+
not_if "test -e \#{node[:passenger_site][:passenger_module_path]}"
|
71
|
+
# creates lambda { "passenger_site[:passenger_module_path]" }
|
60
72
|
end
|
61
73
|
|
62
74
|
@enable_passenger = true
|
@@ -65,15 +77,26 @@ module PoolParty
|
|
65
77
|
|
66
78
|
def passenger_configs
|
67
79
|
unless @passenger_configs
|
80
|
+
|
81
|
+
# requires doesn't work for has_variable?
|
68
82
|
|
83
|
+
# has_variable("passenger_version", passenger_version)
|
84
|
+
# has_variable("passenger_root_path", "\#{languages[:ruby][:gems_dir]}/gems/passenger-#{passenger_version}",
|
85
|
+
# :requires => get_variable("passenger_version"))
|
86
|
+
# has_variable("passenger_module_path", "\#{passenger_site[:passenger_root_path]}/ext/apache2/mod_passenger.so",
|
87
|
+
# :requires => get_variable("passenger_root_path"))
|
88
|
+
|
69
89
|
has_variable("passenger_version", passenger_version)
|
70
|
-
has_variable("passenger_root_path", "\#{languages[:ruby][:gems_dir]}/gems/passenger-#{passenger_version}"
|
71
|
-
|
90
|
+
has_variable("passenger_root_path", "\#{languages[:ruby][:gems_dir]}/gems/passenger-#{passenger_version}",
|
91
|
+
:requires => get_variable("passenger_version"))
|
92
|
+
has_variable("passenger_module_path", "\#{languages[:ruby][:gems_dir]}/gems/passenger-#{passenger_version}/ext/apache2/mod_passenger.so",
|
93
|
+
:requires => get_variable("passenger_root_path"))
|
72
94
|
|
73
95
|
has_file(:name => "/etc/apache2/mods-available/passenger.load") do
|
74
96
|
content <<-eof
|
75
97
|
LoadModule passenger_module <%= @node[:passenger_site][:passenger_module_path] %>
|
76
98
|
eof
|
99
|
+
requires get_exec("install_passenger_script")
|
77
100
|
end
|
78
101
|
|
79
102
|
has_file(:name => "/etc/apache2/mods-available/passenger.conf") do
|
@@ -81,9 +104,10 @@ LoadModule passenger_module <%= @node[:passenger_site][:passenger_module_path] %
|
|
81
104
|
PassengerRoot <%= @node[:passenger_site][:passenger_root_path] %>
|
82
105
|
PassengerRuby <%= @node[:languages][:ruby][:ruby_bin] %>
|
83
106
|
eof
|
107
|
+
requires get_exec("install_passenger_script")
|
84
108
|
end
|
85
109
|
|
86
|
-
present_apache_module(:passenger)
|
110
|
+
present_apache_module(:passenger, {:requires => get_file("/etc/apache2/mods-available/passenger.load")})
|
87
111
|
@passenger_configs = true
|
88
112
|
end
|
89
113
|
end
|
@@ -127,7 +151,7 @@ PassengerRuby <%= @node[:languages][:ruby][:ruby_bin] %>
|
|
127
151
|
|
128
152
|
def enable_default
|
129
153
|
listen 80 # assumes no haproxy
|
130
|
-
site "default-site", :template => File.dirname(__FILE__)/:apache2/"default-site.conf.erb"
|
154
|
+
site "default-site", :template => File.dirname(__FILE__)/:apache2/"default-site.conf.erb", :notifies => get_exec("reload-apache2"), :requires => get_exec("reload-apache2")
|
131
155
|
end
|
132
156
|
|
133
157
|
def config(name, temp)
|
@@ -150,7 +174,7 @@ PassengerRuby <%= @node[:languages][:ruby][:ruby_bin] %>
|
|
150
174
|
else
|
151
175
|
has_exec(:command => "/usr/sbin/a2dissite #{name}") do
|
152
176
|
notifies get_exec("reload-apache2"), :run
|
153
|
-
requires
|
177
|
+
requires get_exec("reload-apache2")
|
154
178
|
only_if "/bin/sh -c \"[ -L /etc/apache2/sites-enabled/#{name} ] && [ /etc/apache2/sites-enabled/#{name} -ef /etc/apache2/sites-available/#{name}]\""
|
155
179
|
end
|
156
180
|
end
|
@@ -159,9 +183,9 @@ PassengerRuby <%= @node[:languages][:ruby][:ruby_bin] %>
|
|
159
183
|
def install_site(name, opts={})
|
160
184
|
sitename = name
|
161
185
|
|
162
|
-
opts.merge!(:name => "/etc/apache2/sites-available/#{sitename}")
|
186
|
+
opts.merge!(:name => "/etc/apache2/sites-available/#{sitename}", :requires => get_package("apache2"))
|
163
187
|
has_directory(:name => "/etc/apache2/sites-available")
|
164
|
-
has_file(opts) unless opts[:no_file]
|
188
|
+
has_file(opts, :requires => get_package("apache2")) unless opts[:no_file]
|
165
189
|
has_exec(:name => "/usr/sbin/a2ensite #{sitename}") do
|
166
190
|
notifies get_exec("reload-apache2"), :run
|
167
191
|
requires get_exec("reload-apache2")
|
@@ -175,12 +199,14 @@ PassengerRuby <%= @node[:languages][:ruby][:ruby_bin] %>
|
|
175
199
|
end
|
176
200
|
|
177
201
|
def present_apache_module(*names)
|
202
|
+
opts = names.pop if names.last.kind_of?(::Hash)
|
178
203
|
names.each do |name|
|
179
204
|
has_exec(:name => "mod-#{name}", :command => "/usr/sbin/a2enmod #{name}") do
|
180
205
|
not_if "/bin/sh -c \'[ -L /etc/apache2/mods-enabled/#{name}.load ] && [ /etc/apache2/mods-enabled/#{name}.load -ef /etc/apache2/mods-available/#{name}.load ]\'"
|
181
206
|
requires get_package("apache2")
|
182
207
|
notifies get_exec("force-reload-apache2"), :run
|
183
208
|
requires get_exec("force-reload-apache2")
|
209
|
+
requires opts[:requires] if opts && opts[:requires]
|
184
210
|
end
|
185
211
|
end
|
186
212
|
end
|
@@ -34,7 +34,7 @@ module PoolParty
|
|
34
34
|
# setup an initial symlink so apache will start even if there have not been any deploys yet
|
35
35
|
#has_site_directory "releases/initial/public"
|
36
36
|
#FIXME the following line is chef specific. It will fail with puppet
|
37
|
-
has_link(:target_file => "#{dir}/#{name}/current", :to => "#{dir}/#{name}/releases/initial")
|
37
|
+
has_link(:target_file => "#{dir}/#{name}/current", :to => "#{dir}/#{name}/releases/initial", :requires => get_directory(site_directory))
|
38
38
|
end
|
39
39
|
log_dir = "#{site_directory}/shared/log"
|
40
40
|
appended_path "current"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module PoolParty
|
2
|
+
module Resources
|
3
|
+
|
4
|
+
class Collectd < Resource
|
5
|
+
|
6
|
+
default_options :server => 'localhost'
|
7
|
+
|
8
|
+
PoolParty::Resources::FileResource.has_searchable_paths(:prepend_paths=> [File.dirname(__FILE__)+'/collectd/templates'])
|
9
|
+
|
10
|
+
def after_loaded
|
11
|
+
%w(rrdtool
|
12
|
+
librrd-dev
|
13
|
+
libsensors-dev
|
14
|
+
libsnmp-dev
|
15
|
+
collectd
|
16
|
+
collectd-dev).each{|pkg|has_package pkg}
|
17
|
+
# has_package librrd-ruby
|
18
|
+
# has_gem_package "astro-collectd"
|
19
|
+
has_variable 'server', server
|
20
|
+
has_file '/etc/collectd/collectd.conf' do
|
21
|
+
template 'collectd.conf.erb'
|
22
|
+
notifies get_service('collectd'), :restart
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,369 @@
|
|
1
|
+
# Config file for collectd(1).
|
2
|
+
#
|
3
|
+
# Some plugins need additional configuration and are disabled by default.
|
4
|
+
# Please read collectd.conf(5) for details.
|
5
|
+
#
|
6
|
+
# You should also read /usr/share/doc/collectd/README.Debian.plugins before
|
7
|
+
# enabling any more plugins.
|
8
|
+
|
9
|
+
#Hostname "localhost"
|
10
|
+
FQDNLookup true
|
11
|
+
#BaseDir "/var/lib/collectd"
|
12
|
+
#PluginDir "/usr/lib/collectd"
|
13
|
+
#TypesDB "/usr/lib/collectd/types.db" "/etc/collectd/my_types.db"
|
14
|
+
#Interval 10
|
15
|
+
#ReadThreads 5
|
16
|
+
|
17
|
+
#LoadPlugin logfile
|
18
|
+
LoadPlugin syslog
|
19
|
+
|
20
|
+
#<Plugin logfile>
|
21
|
+
# LogLevel "info"
|
22
|
+
# File STDOUT
|
23
|
+
# Timestamp true
|
24
|
+
#</Plugin>
|
25
|
+
|
26
|
+
<Plugin syslog>
|
27
|
+
LogLevel info
|
28
|
+
</Plugin>
|
29
|
+
|
30
|
+
#LoadPlugin apache
|
31
|
+
#LoadPlugin apcups
|
32
|
+
#LoadPlugin ascent
|
33
|
+
#LoadPlugin battery
|
34
|
+
LoadPlugin cpu
|
35
|
+
#LoadPlugin cpufreq
|
36
|
+
LoadPlugin csv
|
37
|
+
# LoadPlugin df
|
38
|
+
LoadPlugin disk
|
39
|
+
#LoadPlugin dns
|
40
|
+
#LoadPlugin email
|
41
|
+
#LoadPlugin entropy
|
42
|
+
#LoadPlugin exec
|
43
|
+
#LoadPlugin hddtemp
|
44
|
+
LoadPlugin interface
|
45
|
+
#LoadPlugin ipmi
|
46
|
+
LoadPlugin iptables
|
47
|
+
#LoadPlugin ipvs
|
48
|
+
#LoadPlugin irq
|
49
|
+
# LoadPlugin libvirt
|
50
|
+
LoadPlugin load
|
51
|
+
#LoadPlugin mbmon
|
52
|
+
#LoadPlugin memcached
|
53
|
+
LoadPlugin memory
|
54
|
+
#LoadPlugin multimeter
|
55
|
+
#LoadPlugin mysql
|
56
|
+
#LoadPlugin netlink
|
57
|
+
LoadPlugin network
|
58
|
+
# LoadPlugin nfs
|
59
|
+
#LoadPlugin nginx
|
60
|
+
#LoadPlugin ntpd
|
61
|
+
#LoadPlugin nut
|
62
|
+
#LoadPlugin perl
|
63
|
+
#LoadPlugin ping
|
64
|
+
#LoadPlugin powerdns
|
65
|
+
# LoadPlugin processes
|
66
|
+
LoadPlugin rrdtool
|
67
|
+
#LoadPlugin sensors
|
68
|
+
#LoadPlugin serial
|
69
|
+
#LoadPlugin snmp
|
70
|
+
# LoadPlugin swap
|
71
|
+
#LoadPlugin tail
|
72
|
+
LoadPlugin tcpconns
|
73
|
+
#LoadPlugin teamspeak2
|
74
|
+
#LoadPlugin unixsock
|
75
|
+
LoadPlugin users
|
76
|
+
LoadPlugin uuid
|
77
|
+
#LoadPlugin vmem
|
78
|
+
#LoadPlugin vserver
|
79
|
+
#LoadPlugin wireless
|
80
|
+
|
81
|
+
#<Plugin apache>
|
82
|
+
# URL "http://localhost/status?auto"
|
83
|
+
# User "www-user"
|
84
|
+
# Password "secret"
|
85
|
+
# VerifyPeer false
|
86
|
+
# VerifyHost false
|
87
|
+
# CACert "/etc/ssl/ca.crt"
|
88
|
+
#</Plugin>
|
89
|
+
|
90
|
+
#<Plugin apcups>
|
91
|
+
# Host "localhost"
|
92
|
+
# Port "3551"
|
93
|
+
#</Plugin>
|
94
|
+
|
95
|
+
#<Plugin ascent>
|
96
|
+
# URL "http://localhost/ascent/status/"
|
97
|
+
# User "www-user"
|
98
|
+
# Password "secret"
|
99
|
+
# CACert "/etc/ssl/ca.crt"
|
100
|
+
#</Plugin>
|
101
|
+
|
102
|
+
#<Plugin csv>
|
103
|
+
# DataDir "/var/lib/collectd/csv"
|
104
|
+
# StoreRates false
|
105
|
+
#</Plugin>
|
106
|
+
|
107
|
+
#<Plugin df>
|
108
|
+
# Device "/dev/sda1"
|
109
|
+
# Device "192.168.0.2:/mnt/nfs"
|
110
|
+
# MountPoint "/home/eucalyptus"
|
111
|
+
# FSType "ext3"
|
112
|
+
# IgnoreSelected false
|
113
|
+
# </Plugin>
|
114
|
+
|
115
|
+
#<Plugin disk>
|
116
|
+
# Disk "hda"
|
117
|
+
# Disk "/sda[23]/"
|
118
|
+
# IgnoreSelected false
|
119
|
+
#</Plugin>
|
120
|
+
|
121
|
+
#<Plugin dns>
|
122
|
+
# Interface "eth0"
|
123
|
+
# IgnoreSource "192.168.0.1"
|
124
|
+
#</Plugin>
|
125
|
+
|
126
|
+
#<Plugin email>
|
127
|
+
# SocketGroup "collectd"
|
128
|
+
# SocketPerms "0770"
|
129
|
+
# MaxConns 5
|
130
|
+
#</Plugin>
|
131
|
+
|
132
|
+
#<Plugin exec>
|
133
|
+
# Exec user "/path/to/exec"
|
134
|
+
# Exec "user:group" "/path/to/exec"
|
135
|
+
# NotificationExec user "/path/to/exec"
|
136
|
+
#</Plugin>
|
137
|
+
|
138
|
+
#<Plugin hddtemp>
|
139
|
+
# Host "127.0.0.1"
|
140
|
+
# Port 7634
|
141
|
+
# TranslateDevicename false
|
142
|
+
#</Plugin>
|
143
|
+
|
144
|
+
#<Plugin interface>
|
145
|
+
# Interface "eth0"
|
146
|
+
# IgnoreSelected false
|
147
|
+
#</Plugin>
|
148
|
+
|
149
|
+
#<Plugin iptables>
|
150
|
+
# Chain "table" "chain"
|
151
|
+
#</Plugin>
|
152
|
+
|
153
|
+
#<Plugin irq>
|
154
|
+
# Irq 7
|
155
|
+
# Irq 8
|
156
|
+
# Irq 9
|
157
|
+
# IgnoreSelected true
|
158
|
+
#</Plugin>
|
159
|
+
|
160
|
+
#<Plugin libvirt>
|
161
|
+
# Connection "qemu:///system"
|
162
|
+
# Connection "xen:///"
|
163
|
+
# RefreshInterval 10
|
164
|
+
# Domain "name"
|
165
|
+
# BlockDevice "name:device"
|
166
|
+
# InterfaceDevice "name:device"
|
167
|
+
# IgnoreSelected false
|
168
|
+
# HostnameFormat hostname name
|
169
|
+
# </Plugin>
|
170
|
+
|
171
|
+
#<Plugin mbmon>
|
172
|
+
# Host "127.0.0.1"
|
173
|
+
# Port 411
|
174
|
+
#</Plugin>
|
175
|
+
|
176
|
+
#<Plugin memcached>
|
177
|
+
# Host "127.0.0.1"
|
178
|
+
# Port "11211"
|
179
|
+
#</Plugin>
|
180
|
+
|
181
|
+
#<Plugin mysql>
|
182
|
+
# Host "database.serv.er"
|
183
|
+
# User "db_user"
|
184
|
+
# Password "secret"
|
185
|
+
# Database "db_name"
|
186
|
+
#</Plugin>
|
187
|
+
|
188
|
+
#<Plugin netlink>
|
189
|
+
# Interface "All"
|
190
|
+
# VerboseInterface "All"
|
191
|
+
# QDisc "eth0" "pfifo_fast-1:0"
|
192
|
+
# Class "ppp0" "htb-1:10"
|
193
|
+
# Filter "ppp0" "u32-1:0"
|
194
|
+
# IgnoreSelected false
|
195
|
+
#</Plugin>
|
196
|
+
|
197
|
+
<Plugin network>
|
198
|
+
<%= "Server #{@node[:collectd][:server]}" %>
|
199
|
+
<%= "Listen #{@node.ipaddress} if @node[:collectd][:server] %>"
|
200
|
+
# Server "ff18::efc0:4a42" "25826"
|
201
|
+
# Server "239.192.74.66" "25826"
|
202
|
+
# Listen "ff18::efc0:4a42" "25826"
|
203
|
+
# Listen "239.192.74.66" "25826"
|
204
|
+
# TimeToLive "128"
|
205
|
+
# Forward false
|
206
|
+
# CacheFlush 1800
|
207
|
+
</Plugin>
|
208
|
+
|
209
|
+
#<Plugin nginx>
|
210
|
+
# URL "http://localhost/status?auto"
|
211
|
+
# User "www-user"
|
212
|
+
# Password "secret"
|
213
|
+
# VerifyPeer false
|
214
|
+
# VerifyHost false
|
215
|
+
# CACert "/etc/ssl/ca.crt"
|
216
|
+
#</Plugin>
|
217
|
+
|
218
|
+
#<Plugin ntpd>
|
219
|
+
# Host "localhost"
|
220
|
+
# Port 123
|
221
|
+
# ReverseLookups false
|
222
|
+
#</Plugin>
|
223
|
+
|
224
|
+
#<Plugin nut>
|
225
|
+
# UPS "upsname@hostname:port"
|
226
|
+
#</Plugin>
|
227
|
+
|
228
|
+
#<Plugin perl>
|
229
|
+
# IncludeDir "/my/include/path"
|
230
|
+
# BaseName "Collectd::Plugin"
|
231
|
+
# EnableDebugger ""
|
232
|
+
# LoadPlugin "foo"
|
233
|
+
# LoadPlugin "bar"
|
234
|
+
#</Plugin>
|
235
|
+
|
236
|
+
#<Plugin ping>
|
237
|
+
# Host "host.foo.bar"
|
238
|
+
# Host "host.baz.qux"
|
239
|
+
# TTL 255
|
240
|
+
#</Plugin>
|
241
|
+
|
242
|
+
#<Plugin powerdns>
|
243
|
+
# <Server "server_name">
|
244
|
+
# Collect "latency"
|
245
|
+
# Collect "udp-answers" "udp-queries"
|
246
|
+
# Socket "/var/run/pdns.controlsocket"
|
247
|
+
# </Server>
|
248
|
+
# <Recursor "recursor_name">
|
249
|
+
# Collect "questions"
|
250
|
+
# Collect "cache-hits" "cache-misses"
|
251
|
+
# Socket "/var/run/pdns_recursor.controlsocket"
|
252
|
+
# </Recursor>
|
253
|
+
# LocalSocket "/opt/collectd/var/run/collectd-powerdns"
|
254
|
+
#</Plugin>
|
255
|
+
|
256
|
+
#<Plugin processes>
|
257
|
+
# Process "name"
|
258
|
+
#</Plugin>
|
259
|
+
|
260
|
+
<Plugin rrdtool>
|
261
|
+
DataDir "/var/lib/collectd/rrd"
|
262
|
+
# CacheTimeout 120
|
263
|
+
# CacheFlush 900
|
264
|
+
#
|
265
|
+
# The following settings are rather advanced
|
266
|
+
# and should usually not be touched:
|
267
|
+
# StepSize 10
|
268
|
+
# HeartBeat 20
|
269
|
+
# RRARows 1200
|
270
|
+
# RRATimespan 158112000
|
271
|
+
# XFF 0.1
|
272
|
+
</Plugin>
|
273
|
+
|
274
|
+
#<Plugin sensors>
|
275
|
+
# Sensor "it8712-isa-0290/temperature-temp1"
|
276
|
+
# Sensor "it8712-isa-0290/fanspeed-fan3"
|
277
|
+
# Sensor "it8712-isa-0290/voltage-in8"
|
278
|
+
# IgnoreSelected false
|
279
|
+
#</Plugin>
|
280
|
+
|
281
|
+
# See /usr/share/doc/collectd/examples/snmp-data.conf.gz for a
|
282
|
+
# comprehensive sample configuration.
|
283
|
+
#<Plugin snmp>
|
284
|
+
# <Data "powerplus_voltge_input">
|
285
|
+
# Type "voltage"
|
286
|
+
# Table false
|
287
|
+
# Instance "input_line1"
|
288
|
+
# Values "SNMPv2-SMI::enterprises.6050.5.4.1.1.2.1"
|
289
|
+
# </Data>
|
290
|
+
# <Data "hr_users">
|
291
|
+
# Type "users"
|
292
|
+
# Table false
|
293
|
+
# Instance ""
|
294
|
+
# Values "HOST-RESOURCES-MIB::hrSystemNumUsers.0"
|
295
|
+
# </Data>
|
296
|
+
# <Data "std_traffic">
|
297
|
+
# Type "if_octets"
|
298
|
+
# Table true
|
299
|
+
# Instance "IF-MIB::ifDescr"
|
300
|
+
# Values "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
|
301
|
+
# </Data>
|
302
|
+
#
|
303
|
+
# <Host "some.switch.mydomain.org">
|
304
|
+
# Address "192.168.0.2"
|
305
|
+
# Version 1
|
306
|
+
# Community "community_string"
|
307
|
+
# Collect "std_traffic"
|
308
|
+
# Inverval 120
|
309
|
+
# </Host>
|
310
|
+
# <Host "some.server.mydomain.org">
|
311
|
+
# Address "192.168.0.42"
|
312
|
+
# Version 2
|
313
|
+
# Community "another_string"
|
314
|
+
# Collect "std_traffic" "hr_users"
|
315
|
+
# </Host>
|
316
|
+
# <Host "some.ups.mydomain.org">
|
317
|
+
# Address "192.168.0.3"
|
318
|
+
# Version 1
|
319
|
+
# Community "more_communities"
|
320
|
+
# Collect "powerplus_voltge_input"
|
321
|
+
# Interval 300
|
322
|
+
# </Host>
|
323
|
+
#</Plugin>
|
324
|
+
|
325
|
+
#<Plugin "tail">
|
326
|
+
# <File "/var/log/exim4/mainlog">
|
327
|
+
# Instance "exim"
|
328
|
+
# <Match>
|
329
|
+
# Regex "S=([1-9][0-9]*)"
|
330
|
+
# DSType "CounterAdd"
|
331
|
+
# Type "ipt_bytes"
|
332
|
+
# Instance "total"
|
333
|
+
# </Match>
|
334
|
+
# <Match>
|
335
|
+
# Regex "\\<R=local_user\\>"
|
336
|
+
# DSType "CounterInc"
|
337
|
+
# Type "counter"
|
338
|
+
# Instance "local_user"
|
339
|
+
# </Match>
|
340
|
+
# </File>
|
341
|
+
#</Plugin>
|
342
|
+
|
343
|
+
#<Plugin tcpconns>
|
344
|
+
# ListeningPorts false
|
345
|
+
# LocalPort "25"
|
346
|
+
# RemotePort "25"
|
347
|
+
#</Plugin>
|
348
|
+
|
349
|
+
#<Plugin teamspeak2>
|
350
|
+
# Host "127.0.0.1"
|
351
|
+
# Port "51234"
|
352
|
+
# Server "8767"
|
353
|
+
#</Plugin>
|
354
|
+
|
355
|
+
#<Plugin unixsock>
|
356
|
+
# SocketFile "/var/run/collectd-unixsock"
|
357
|
+
# SocketGroup "collectd"
|
358
|
+
# SocketPerms "0660"
|
359
|
+
#</Plugin>
|
360
|
+
|
361
|
+
#<Plugin uuid>
|
362
|
+
# UUIDFile "/etc/uuid"
|
363
|
+
#</Plugin>
|
364
|
+
|
365
|
+
#<Plugin vmem>
|
366
|
+
# Verbose false
|
367
|
+
#</Plugin>
|
368
|
+
|
369
|
+
Include "/etc/collectd/thresholds.conf"
|