Monitor ping times and reachability from tile caches to renderers
authorTom Hughes <tom@compton.nu>
Wed, 22 Jan 2014 10:46:55 +0000 (10:46 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 22 Jan 2014 10:51:04 +0000 (10:51 +0000)
cookbooks/tilecache/metadata.rb
cookbooks/tilecache/recipes/default.rb
cookbooks/tilecache/templates/default/munin.ping.erb [new file with mode: 0644]

index cda3854..ed816a9 100644 (file)
@@ -8,4 +8,4 @@ version           "1.0.0"
 depends           "ssl"
 depends           "squid"
 depends           "nginx"
-
+depends           "munin"
index b6db401..13f752c 100644 (file)
@@ -80,3 +80,10 @@ nginx_site "tile-ssl" do
   template "nginx_tile_ssl.conf.erb"
 end
 
+tilerenders.each do |render|
+  munin_plugin "ping_#{render[:fqdn]}" do
+    target "ping_"
+    conf "munin.ping.erb"
+    conf_variables :host => render[:fqdn]
+  end
+end
diff --git a/cookbooks/tilecache/templates/default/munin.ping.erb b/cookbooks/tilecache/templates/default/munin.ping.erb
new file mode 100644 (file)
index 0000000..b09f976
--- /dev/null
@@ -0,0 +1,8 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+[ping_<%= @host %>]
+env.ping_args -c 1 -w 20
+env.ping_warn 0.5
+env.ping_crit 1.0
+env.packetloss_warn 10
+env.packetloss_crit 30