From c467f2c028c05dea254d61f8e797d6b3ba1680b2 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sun, 11 Mar 2012 16:09:34 -0400 Subject: add $use_munin parameter that will enable graphs --- manifests/init.pp | 4 ++++ manifests/munin.pp | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 manifests/munin.pp (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index c8ac5f3..90782b1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 index 0000000..6e6e0fa --- /dev/null +++ b/manifests/munin.pp @@ -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"; + } +} -- cgit v1.2.3