diff --git a/.travis.yml b/.travis.yml index a839622..7931721 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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= diff --git a/CHANGELOG.md b/CHANGELOG.md index 727c5e3..9de31f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/attributes/default.rb b/attributes/default.rb index 16c6bc9..fbc4405 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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'] diff --git a/metadata.rb b/metadata.rb index 4f2d21d..5aa3ba0 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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' diff --git a/recipes/collectd.rb b/recipes/collectd.rb index d2f3408..20725a0 100644 --- a/recipes/collectd.rb +++ b/recipes/collectd.rb @@ -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 diff --git a/recipes/master.rb b/recipes/master.rb index 9591fa3..fe5dd1f 100644 --- a/recipes/master.rb +++ b/recipes/master.rb @@ -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' diff --git a/recipes/slave.rb b/recipes/slave.rb index b9c4e67..799d38d 100644 --- a/recipes/slave.rb +++ b/recipes/slave.rb @@ -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' diff --git a/templates/default/plugin.conf.erb b/templates/default/plugin.conf.erb new file mode 100644 index 0000000..01f83b2 --- /dev/null +++ b/templates/default/plugin.conf.erb @@ -0,0 +1,11 @@ +# This file autogenerated by Chef +# Do not edit, changes will be overwritten +LoadPlugin "<%= @name %>" + +"> + "> + <% @options.each_pair do |key, value| %> + <%= collectd_key(key) %> <%= collectd_option(value) %> + <% end %> + +