From: Tom Hughes Date: Tue, 2 Sep 2014 20:29:40 +0000 (+0100) Subject: Use rrdcached with munin X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/60b1f7f088490d6904ce549956d33e2992963e79 Use rrdcached with munin --- 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