]> gitweb.fluxo.info Git - puppet-tor.git/commitdiff
add $use_munin parameter that will enable graphs
authorMicah Anderson <micah@riseup.net>
Sun, 11 Mar 2012 20:09:34 +0000 (16:09 -0400)
committerMicah Anderson <micah@riseup.net>
Sun, 11 Mar 2012 20:09:34 +0000 (16:09 -0400)
manifests/init.pp
manifests/munin.pp [new file with mode: 0644]

index c8ac5f370ffb7a5764a742ddacf345aff7066dc4..90782b17a72e3ae47a96b6d7230c98d4aeb25cec 100644 (file)
@@ -13,4 +13,8 @@ class tor {
     hasstatus => true,
     require => Package['tor'],
   }
+
+  if $use_munin {
+    include tor::munin
+  }
 }
diff --git a/manifests/munin.pp b/manifests/munin.pp
new file mode 100644 (file)
index 0000000..6e6e0fa
--- /dev/null
@@ -0,0 +1,23 @@
+class tor::munin {
+
+  file {
+    "/usr/local/share/munin-plugins/tor_connections":
+      source => "puppet://$server/modules/tor/munin/tor_connections",
+      mode => 0755, owner => root, group => root;
+    
+    "/usr/local/share/munin-plugins/tor_routers":
+      source => "puppet://$server/modules/tor/munin/tor_routers",
+      mode => 0755, owner => root, group => root;
+
+    "/usr/local/share/munin-plugins/tor_traffic":
+      source => "puppet://$server/modules/tor/munin/tor_traffic",
+      mode => 0755, owner => root, group => root;
+  }
+
+  munin::plugin {
+    [ "tor_connections", "tor_routers", "tor_traffic" ]:
+      ensure => present,
+      config => "user debian-tor\n env.cookiefile /var/lib/tor/control_auth_cookie",
+      script_path_in => "/usr/local/share/munin-plugins";
+  }
+}