summaryrefslogtreecommitdiff
path: root/manifests/host.pp
blob: b9e59e4e9425fc3e3ccc85adf71af46b465270f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# host.pp - the master host of the munin installation
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
# See LICENSE for the full license granted to you.

class munin::host inherits munin
{

  if $munin_ensure_version == '' { $munin_ensure_version = 'installed' }

  File <<| tag == 'munin' |>>

  package {"munin": ensure => $munin_ensure_version, }
  
  File <<| tag == 'munin' |>>
  
  file{'/etc/munin/munin.conf.header':
    source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/munin.conf.header",
                "puppet://$server/modules/site-munin/config/host/munin.conf.header.$operatingsystem",
                "puppet://$server/modules/site-munin/config/host/munin.conf.header",
                "puppet://$server/modules/munin/config/host/munin.conf.header.$operatingsystem",
                "puppet://$server/modules/munin/config/host/munin.conf.header" ],
    notify => Exec['concat_/etc/munin/munin.conf'],
    owner => root, group => 0, mode => 0644;
  }
  
  concatenated_file { "/etc/munin/munin.conf":
    dir => '/var/lib/puppet/modules/munin/nodes',
    header => "/etc/munin/munin.conf.header",
  }
  
  file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", 
          "/var/log/munin-graph.log", "/var/log/munin-html.log"]:
            ensure => present,
            mode => 640, owner => munin, group => 0;
  }
  
  include munin::plugins::muninhost
  
  case $operatingsystem {
    centos: {
      include munin::host::cgi
      # from time to time we cleanup hanging munin-runs
      file{'/etc/cron.d/munin_kill':
        content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
        owner => root, group => 0, mode => 0644;
      }
    }
  }
  if $use_shorewall {
    include shorewall::rules::out::munin
  }
}