From 60b1f7f088490d6904ce549956d33e2992963e79 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 2 Sep 2014 21:29:40 +0100 Subject: [PATCH 1/1] Use rrdcached with munin --- cookbooks/munin/recipes/server.rb | 19 ++++++++++++++++++ .../munin/templates/default/munin.conf.erb | 3 +++ .../munin/templates/default/rrdcached.erb | 20 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 cookbooks/munin/templates/default/rrdcached.erb diff --git a/cookbooks/munin/recipes/server.rb b/cookbooks/munin/recipes/server.rb index ed7aeac44..983f92231 100644 --- a/cookbooks/munin/recipes/server.rb +++ b/cookbooks/munin/recipes/server.rb @@ -20,6 +20,25 @@ include_recipe "apache" package "munin" +package "rrdcached" + +template "/etc/default/rrdcached" do + source "rrdcached.erb" + owner "root" + group "root" + mode 0644 +end + +directory "/var/lib/munin/rrdcached" do + owner "munin" + group "munin" + mode 0755 +end + +service "rrdcached" do + action [ :enable, :start ] + subscribes :restart, "template[/etc/default/rrdcached]" +end expiry_time = 14 * 86400 diff --git a/cookbooks/munin/templates/default/munin.conf.erb b/cookbooks/munin/templates/default/munin.conf.erb index 4926a07f9..dd41cd95a 100644 --- a/cookbooks/munin/templates/default/munin.conf.erb +++ b/cookbooks/munin/templates/default/munin.conf.erb @@ -1,5 +1,8 @@ # DO NOT EDIT - This file is being maintained by Chef +# Use rrdcached +rrdcached_socket /var/run/rrdcached.sock + # Configure alert targets contact.admins.command mail -s "Munin Notification" admins@openstreetmap.org contact.null.command cat > /dev/null diff --git a/cookbooks/munin/templates/default/rrdcached.erb b/cookbooks/munin/templates/default/rrdcached.erb new file mode 100644 index 000000000..f89b91ae1 --- /dev/null +++ b/cookbooks/munin/templates/default/rrdcached.erb @@ -0,0 +1,20 @@ +# DO NOT EDIT - This file is being maintained by Chef + +# 0: start rrdcached on boot, 1: do not start rrdcached on boot +# default: 0 +DISABLE=0 + +# options to be passed to rrdcached +# (do not specify -p - this is handled by the init script) +# default: see /etc/init.d/rrdcached +OPTS="-s munin -m 660 -l unix:/var/run/rrdcached.sock -w 1800 -z 1800 -j /var/lib/munin/rrdcached -F -b /var/lib/munin -B" + +# number of seconds to wait for rrdcached to shut down +# (writing the data to disk may take some time; +# tune this according to your setup) +# default: 30 +MAXWAIT=30 + +# 0: do not enable core-files, 1: enable core-files ... if rrdcached crashes +# default: 0 +ENABLE_COREFILES=0 -- 2.39.5