]> git.openstreetmap.org Git - chef.git/commitdiff
Use rrdcached with munin
authorTom Hughes <tom@compton.nu>
Tue, 2 Sep 2014 20:29:40 +0000 (21:29 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 2 Sep 2014 20:29:40 +0000 (21:29 +0100)
cookbooks/munin/recipes/server.rb
cookbooks/munin/templates/default/munin.conf.erb
cookbooks/munin/templates/default/rrdcached.erb [new file with mode: 0644]

index ed7aeac44bf5bc326cbc2e1db4698ec8bdf03a87..983f92231adbb52672068dbd60b7374ba9b31664 100644 (file)
 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
 
index 4926a07f99e3b0b3ef9b223ec08d1fabb138632c..dd41cd95ab8080a13f49cb70c844a230fc572be7 100644 (file)
@@ -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 (file)
index 0000000..f89b91a
--- /dev/null
@@ -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 <pidfile> - 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