added gentoo to munin module
authorandreas <andreas@immerda.ch>
Tue, 4 Dec 2007 09:08:38 +0000 (09:08 +0000)
committerandreas <andreas@immerda.ch>
Tue, 4 Dec 2007 09:08:38 +0000 (09:08 +0000)
manifests/client.pp
manifests/plugin.pp

index 5b78186..f5caaec 100644 (file)
@@ -22,6 +22,11 @@ class munin::client {
                        include munin::client::debian
                        include munin::plugins::debian
                }
+               gentoo: {
+                       include munin::client::gentoo
+                       include munin::plugins::gentoo
+       
+               }
                default: { fail ("Don't know how to handle munin on $operatingsystem") }
        }
 
@@ -120,3 +125,35 @@ class munin::client::debian
        plugin { "postfix_mailvolume": ensure => absent }
 }
 
+class munin::client::gentoo 
+{
+        package { 'munin':
+                ensure => present,
+                category => $operatingsystem ? {
+                        gentoo => 'net-analyzer',
+                        default => '',
+                },
+        }
+
+
+       file {
+               "/etc/munin/":
+                       ensure => directory,
+                       mode => 0755, owner => root, group => root;
+               "/etc/munin/munin-node.conf":
+                       content => template("munin/munin-node.conf.Gentoo."),
+                       mode => 0644, owner => root, group => root,
+                       # this has to be installed before the package, so the postinst can
+                       # boot the munin-node without failure!
+                       before => Package["munin-node"],
+                       notify => Service["munin-node"],
+       }
+
+       service { "munin":
+               ensure => running, 
+       }
+
+       munin::register { $fqdn: }
+
+}
+
index e7e22d1..f07b5fa 100644 (file)
@@ -125,3 +125,10 @@ class munin::plugins::vserver inherits munin::plugins::base {
        }
 
 }
+
+class munin::plugins::gentoo inherits munin::plugins::base {
+       plugin {
+               [ netstat, processes ]:
+                       ensure => present;
+       }
+}