Skip to content

Commit

Permalink
Merge pull request #49 from rightscale-cookbooks/collectd-5-fix
Browse files Browse the repository at this point in the history
updating for collectd5
  • Loading branch information
cdwilhelm committed Jun 1, 2016
2 parents e66c458 + 44cb53a commit 962053e
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ before_script: cat Berksfile; bundle exec berks install; bundle exec berks list
script: bundle exec strainer test --except kitchen
notifications:
slack:
secure: TIZFCcm+FcFBB6IoEBv2174qwXe1SxVsGpkMe6eZjccVwmgRt2ik8To03Orpjy/2VOztuqJdDqmHOucbmoL/67W2rnAHjVk85dlGGv60Xqf4F+oSfmc0igESocfZLbv0yhD2SBDIt/RGRqQyGEW1YmNsk7QiFx0HqnXpn0aycaA=
secure: il5rpAZCNPhfsXVijr7kcg42cA0hH7P6zXvfuXaCSbSbme1fmz5Vh/INmir8nrnTyxEELZ2+M8qJJuH/qIjTeM02n/q9pkklOHnmyN2D5jhTc9ZtRjZPy4YMmYo/uYXsx8QzcD8YWvI/WO8+Xec9OixY43ct0aAUCRqX4IX67hQ=
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ rs-mysql Cookbook CHANGELOG

This file is used to list changes made in each version of the rs-mysql cookbook.

v1.2.3
------

- Updates collectd monitors to work with collectd v5

v1.2.2
-------
------

- Run pvscan after volumes attached for stripe. Behavior seen in CentOS 6.6 where volumes attached are not
immediately seen as part of a Logical Volume.
Expand Down
5 changes: 5 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@

# Dump file location in repository to import.
default['rs-mysql']['import']['dump_file'] = nil

# Sets up empty collectd options for v5
default['rs-mysql']['collectd']['mysql']['User'] = 'root'
default['rs-mysql']['collectd']['mysql']['Socket'] = '/var/run/mysqld/mysqld.sock'
default['rs-mysql']['collectd']['mysql']['Password'] = node['rs-mysql']['server_root_password']
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs and configures a MySQL server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.2.2'
version '1.2.3'

depends 'chef_handler', '~> 1.1.6'
depends 'marker', '~> 1.0.1'
Expand Down
12 changes: 7 additions & 5 deletions recipes/collectd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
action :nothing
end

collectd_plugin 'processes' do
options :process => [ 'collectd', 'mysqld' ]
end

collectd_plugin 'mysql' do
options({
'Host' => 'localhost',
'User' => 'root',
'Password' => node['rs-mysql']['server_root_password']
})
cookbook 'rs-mysql'
template 'plugin.conf.erb'
options( node['rs-mysql']['collectd']['mysql'] )
end
3 changes: 3 additions & 0 deletions recipes/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,6 @@
missing_dns_creds.map! { |cred| "rs-mysql/dns/#{cred}" }
log "Following DNS credentials are missing #{missing_dns_creds.join(', ')}! Skipping DNS setting..."
end

node.default['rs-mysql']['collectd']['mysql']['MasterStats']='true'
include_recipe 'rs-mysql::collectd'
4 changes: 4 additions & 0 deletions recipes/slave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ class Chef::Recipe
backup false
action :delete
end

node.default['rs-mysql']['collectd']['mysql']['SlaveStats'] = 'true'
node.default['rs-mysql']['collectd']['mysql']['SlaveNotifications'] = 'true'
include_recipe 'rs-mysql::collectd'
11 changes: 11 additions & 0 deletions templates/default/plugin.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file autogenerated by Chef
# Do not edit, changes will be overwritten
LoadPlugin "<%= @name %>"

<Plugin "<%= @name %>">
<Database "<%= @name %>">
<% @options.each_pair do |key, value| %>
<%= collectd_key(key) %> <%= collectd_option(value) %>
<% end %>
</Database>
</Plugin>

0 comments on commit 962053e

Please sign in to comment.