From 9e97ddf51a0ecd71ce62d11094caaeeeae3d7e31 Mon Sep 17 00:00:00 2001 From: Nathan L Smith Date: Sat, 24 Mar 2012 21:21:54 -0500 Subject: [PATCH 1/2] install whisper bins --- recipes/whisper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/whisper.rb b/recipes/whisper.rb index defa39c..dcf1bed 100644 --- a/recipes/whisper.rb +++ b/recipes/whisper.rb @@ -16,3 +16,8 @@ creates "/usr/local/lib/python2.6/dist-packages/whisper-#{version}.egg-info" cwd "/usr/src/whisper-#{version}" end + +execute 'install whisper utils' do + command "cp -R /usr/src/whisper-#{version}/bin/* /opt/graphite/bin" + creates '/opt/graphite/bin/rrd2whisper.py' # and more +end From e6aa24ea0671fc9dddef300d95782dd563a327aa Mon Sep 17 00:00:00 2001 From: Nathan L Smith Date: Sat, 24 Mar 2012 22:42:42 -0500 Subject: [PATCH 2/2] Whisper updates --- attributes/graphite.rb | 8 ++++++++ recipes/carbon.rb | 1 + recipes/whisper.rb | 2 +- templates/default/storage-schemas.conf.erb | 14 ++++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/attributes/graphite.rb b/attributes/graphite.rb index b759439..3b4e139 100644 --- a/attributes/graphite.rb +++ b/attributes/graphite.rb @@ -12,6 +12,14 @@ default[:graphite][:carbon][:line_receiver_interface] = "127.0.0.1" default[:graphite][:carbon][:pickle_receiver_interface] = "127.0.0.1" default[:graphite][:carbon][:cache_query_interface] = "127.0.0.1" +default['graphite']['carbon']['storage_schemas'] = [ + { + :name => :catchall, + :priority => 0, + :pattern => '^.*', + :retentions => '10s:6h,1m:7d,10m:5y' + } +] default[:graphite][:password] = "change_me" default[:graphite][:url] = "graphite" diff --git a/recipes/carbon.rb b/recipes/carbon.rb index 0a0f356..7a53fe9 100644 --- a/recipes/carbon.rb +++ b/recipes/carbon.rb @@ -32,6 +32,7 @@ template "/opt/graphite/conf/storage-schemas.conf" do owner "www-data" group "www-data" + notifies :restart, 'service[carbon-cache]' end execute "carbon: change graphite storage permissions to www-data" do diff --git a/recipes/whisper.rb b/recipes/whisper.rb index dcf1bed..6361386 100644 --- a/recipes/whisper.rb +++ b/recipes/whisper.rb @@ -18,6 +18,6 @@ end execute 'install whisper utils' do - command "cp -R /usr/src/whisper-#{version}/bin/* /opt/graphite/bin" + command "cp /usr/src/whisper-#{version}/bin/* /opt/graphite/bin" creates '/opt/graphite/bin/rrd2whisper.py' # and more end diff --git a/templates/default/storage-schemas.conf.erb b/templates/default/storage-schemas.conf.erb index a676ce7..11c0cfc 100644 --- a/templates/default/storage-schemas.conf.erb +++ b/templates/default/storage-schemas.conf.erb @@ -1,4 +1,10 @@ -[catchall] -priority = 0 -pattern = ^.* -retentions = 60:100800,900:63000 +# Carbon storage schemas.See http://readthedocs.org/docs/graphite/en/latest/config-carbon.html#storage-schemas-conf +# +# Generated by Chef + +<% node['graphite']['carbon']['storage_schemas'].each do |schema| %> +[<%= schema[:name] %>] +priority = <%= schema[:priority] %> +pattern = <%= schema[:pattern] %> +retentions = <%= schema[:retentions] %> +<% end %>