]> git.openstreetmap.org Git - chef.git/commitdiff
Add some basic compound graphs for the render servers
authorTom Hughes <tom@compton.nu>
Thu, 29 Aug 2013 18:27:41 +0000 (19:27 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 29 Aug 2013 18:39:24 +0000 (19:39 +0100)
cookbooks/munin/recipes/server.rb
cookbooks/munin/templates/default/munin.conf.erb

index 1e51b4c4a14dccca4919a0212340d5f150549e5f..ed7aeac44bf5bc326cbc2e1db4698ec8bdf03a87 100644 (file)
@@ -29,13 +29,16 @@ backends = search(:node, "recipes:web\\:\\:backend").reject { |n| Time.now - Tim
 tilecaches = search(:node, "roles:tilecache").reject { |n| Time.now - Time.at(n[:ohai_time]) > expiry_time }.sort_by { |n| n[:hostname] }.map do |n|
   { :name => n[:hostname], :interface => n.interfaces(:role => :external).first[:interface] }
 end
+renderers = search(:node, "roles:tile").reject { |n| Time.now - Time.at(n[:ohai_time]) > expiry_time }.sort_by { |n| n[:hostname] }.map do |n|
+  { :name => n[:hostname], :interface => n.interfaces(:role => :external).first[:interface] }
+end
 
 template "/etc/munin/munin.conf" do
   source "munin.conf.erb"
   owner "root"
   group "root"
   mode 0644
-  variables :expiry_time => expiry_time, :clients => clients, :frontends => frontends, :backends => backends, :tilecaches => tilecaches
+  variables :expiry_time => expiry_time, :clients => clients, :frontends => frontends, :backends => backends, :tilecaches => tilecaches, :renderers => renderers
 end
 
 apache_site "munin.openstreetmap.org" do
index 16205df698f60bcd6670d9288dac885b3709c8dd..82ffb6dab64a77502c85551974544d32a4af72b9 100644 (file)
@@ -336,3 +336,45 @@ unknown_limit 144
 <% @tilecaches.each do |tc| -%>
     squid_times_dnsl.<%= tc[:name] %>.label <%= tc[:name] %>
 <% end -%>
+
+# Configure compound graphs for render.openstreetmap.org
+[render.openstreetmap]
+    update no
+    apache_accesses.graph_title Apache accesses
+    apache_accesses.graph_vlabel accesses / ${graph_period}
+    apache_accesses.graph_category apache
+    apache_accesses.graph_order <%= Chef::Munin.expand "%%name%%=%%name%%.openstreetmap:apache_accesses.accesses80", @renderers %>
+    apache_accesses.graph_total total
+<% @renderers.each do |rs| -%>
+    apache_accesses.<%= rs[:name] %>.label <%= rs[:name] %>
+    apache_accesses.<%= rs[:name] %>.draw AREASTACK
+<% end -%>
+    apache_volume.graph_title Apache volume
+    apache_volume.graph_vlabel bytes per ${graph_period}
+    apache_volume.graph_category apache
+    apache_volume.graph_order <%= Chef::Munin.expand "%%name%%=%%name%%.openstreetmap:apache_volume.volume80", @renderers %>
+    apache_volume.graph_total total
+<% @renderers.each do |rs| -%>
+    apache_volume.<%= rs[:name] %>.label <%= rs[:name] %>
+    apache_volume.<%= rs[:name] %>.draw AREASTACK
+<% end -%>
+    network_in.graph_title Inbound network traffic
+    network_in.graph_vlabel bits in per ${graph_period}
+    network_in.graph_category network
+    network_in.graph_order <%= Chef::Munin.expand "%%name%%=%%name%%.openstreetmap:if_%%interface%%.down", @renderers %>
+    network_in.graph_total total
+<% @renderers.each do |rs| -%>
+    network_in.<%= rs[:name] %>.label <%= rs[:name] %>
+    network_in.<%= rs[:name] %>.cdef <%= rs[:name] %>,8,*
+    network_in.<%= rs[:name] %>.draw AREASTACK
+<% end -%>
+    network_out.graph_title Outbound network traffic
+    network_out.graph_vlabel bits out per ${graph_period}
+    network_out.graph_category network
+    network_out.graph_order <%= Chef::Munin.expand "%%name%%=%%name%%.openstreetmap:if_%%interface%%.up", @renderers %>
+    network_out.graph_total total
+<% @renderers.each do |rs| -%>
+    network_out.<%= rs[:name] %>.label <%= rs[:name] %>
+    network_out.<%= rs[:name] %>.cdef <%= rs[:name] %>,8,*
+    network_out.<%= rs[:name] %>.draw AREASTACK
+<% end -%>