diff options
Diffstat (limited to 'manifests/client.pp')
-rw-r--r-- | manifests/client.pp | 119 |
1 files changed, 63 insertions, 56 deletions
diff --git a/manifests/client.pp b/manifests/client.pp index 0ad7856..9a7b772 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,6 +1,7 @@ # client.pp - configure a munin node # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at> # See LICENSE for the full license granted to you. +# Adapted and improved by admin(at)immerda.ch class munin::client { @@ -11,37 +12,14 @@ class munin::client { default => $munin_host } - case $operatingsystem { - darwin: { include munin::client::darwin } - debian: { - include munin::client::debian - include munin::plugins::debian - } - ubuntu: { - info ( "Trying to configure Ubuntu's munin with Debian class" ) - include munin::client::debian - include munin::plugins::debian - } - default: { fail ("Don't know how to handle munin on $operatingsystem") } - } - - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - case $virtual { - xen0: { include munin::plugins::xen } - } - } - } - } - default: { - err( "Don't know which munin plugins to install for $kernel" ) - } - } - + case $operatingsystem { + darwin: { include munin::client::darwin } + debian: { include munin::client::debian } + ubuntu: { include munin::client::ubuntu } + centos: { include munin::client::centos } + gentoo: { include munin::client::gentoo } + default: { include munin::client::base } + } } define munin::register() @@ -69,12 +47,40 @@ define munin::register_snmp() } } -class munin::client::darwin -{ +class munin::client::base { + package { "munin-node": ensure => installed } + service { "munin-node": + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + require => Package[munin-node], + } + file {"/etc/munin/": + ensure => directory, + mode => 0755, owner => root, group => 0; + } + $real_munin_allow = $munin_allow ? { + '' => '127.0.0.1', + default => $munin_allow + } + file {"/etc/munin/munin-node.conf": + content => template("munin/munin-node.conf.$operatingsystem"), + # 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'], + mode => 0644, owner => root, group => 0, + } + munin::register { $fqdn: } + include munin::plugins::base +} + +class munin::client::darwin { file { "/usr/share/snmp/snmpd.conf": mode => 744, content => template("munin/darwin_snmpd.conf.erb"), - group => staff, + group => 0, owner => root, } delete_matching_line{"startsnmpdno": @@ -92,33 +98,34 @@ class munin::client::darwin munin::register_snmp { $fqdn: } } -class munin::client::debian -{ - - package { "munin-node": ensure => installed } +class munin::client::debian inherits munin::client::base { + # the plugin will need that + package { "iproute": ensure => installed } - file { - "/etc/munin/": - ensure => directory, - mode => 0755, owner => root, group => root; - "/etc/munin/munin-node.conf": - content => template("munin/munin-node.conf.${operatingsystem}.${lsbdistcodename}"), - 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-node": - ensure => running, + Service["munin-node"]{ # sarge's munin-node init script has no status hasstatus => $lsbdistcodename ? { sarge => false, default => true } } - - munin::register { $fqdn: } - + File["/etc/munin/munin-node.conf"]{ + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), + } # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian } +class munin::client::ubuntu inherits munin::client::debian {} + +class munin::client::gentoo inherits munin::client::base { + Package['munin-node'] { + name => 'munin', + category => 'net-analyzer', + } + + + include munin::plugins::gentoo +} + +class munin::client::centos inherits munin::client::base { + include munin::plugins::centos +} |