From 3547ad9c1d03d5a7b4694ef19143144bd50f430c Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Wed, 1 Jun 2016 10:53:01 -0500 Subject: [PATCH 1/5] updating version --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index f234ba0..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.1' +version '1.2.3' depends 'chef_handler', '~> 1.1.6' depends 'marker', '~> 1.0.1' From 8cba2835f5927a82c0826ef2214de818056e9efa Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Wed, 1 Jun 2016 12:45:20 -0500 Subject: [PATCH 2/5] updating collectd --- attributes/default.rb | 5 +++++ recipes/collectd.rb | 10 +++++----- recipes/master.rb | 3 +++ recipes/slave.rb | 4 ++++ 4 files changed, 17 insertions(+), 5 deletions(-) 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/recipes/collectd.rb b/recipes/collectd.rb index d2f3408..973292f 100644 --- a/recipes/collectd.rb +++ b/recipes/collectd.rb @@ -51,10 +51,10 @@ action :nothing end +collectd_plugin 'processes' do + options :process => 'collectd', :process => 'mysqld' +end + collectd_plugin 'mysql' do - options({ - 'Host' => 'localhost', - 'User' => 'root', - 'Password' => node['rs-mysql']['server_root_password'] - }) + options( :database => node['rs-mysql']['collectd'] ) 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' From 44fd2b8bd2f344e000e2b9dd95ac85ac8c864d09 Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Wed, 1 Jun 2016 15:48:42 -0500 Subject: [PATCH 3/5] adding plugin --- recipes/collectd.rb | 4 +++- templates/default/plugin.conf.erb | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 templates/default/plugin.conf.erb diff --git a/recipes/collectd.rb b/recipes/collectd.rb index 973292f..98c2b55 100644 --- a/recipes/collectd.rb +++ b/recipes/collectd.rb @@ -56,5 +56,7 @@ end collectd_plugin 'mysql' do - options( :database => node['rs-mysql']['collectd'] ) + cookbook 'rs-mysql' + template 'plugin.conf.erb' + options( 'database' => 'mysql', 'dbopts' => node['rs-mysql']['collectd']['mysql'] ) end 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 %> + + From 2e321ed833386600070f06f89963c7bc73968d69 Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Wed, 1 Jun 2016 16:03:27 -0500 Subject: [PATCH 4/5] fixing stats in collectd --- recipes/collectd.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/collectd.rb b/recipes/collectd.rb index 98c2b55..20725a0 100644 --- a/recipes/collectd.rb +++ b/recipes/collectd.rb @@ -52,11 +52,11 @@ end collectd_plugin 'processes' do - options :process => 'collectd', :process => 'mysqld' + options :process => [ 'collectd', 'mysqld' ] end collectd_plugin 'mysql' do cookbook 'rs-mysql' template 'plugin.conf.erb' - options( 'database' => 'mysql', 'dbopts' => node['rs-mysql']['collectd']['mysql'] ) + options( node['rs-mysql']['collectd']['mysql'] ) end From 44cb53aa6903d76ec4a63be4c9900168edbfe6d3 Mon Sep 17 00:00:00 2001 From: Richard Shade Date: Wed, 1 Jun 2016 16:15:41 -0500 Subject: [PATCH 5/5] updating changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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.