summaryrefslogtreecommitdiff
path: root/manifests/host.pp
blob: f89cbb8cbb11a21d9771b0e47662e30d1ea4274a (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
# 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
{
	package { [ "munin", "nmap"]: ensure => installed, }

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

	concatenated_file { "/etc/munin/munin.conf":
		dir => $NODESDIR,
		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 => root;
  }
	
}

class munin::snmp_collector
{

	file { 
		"${module_dir_path}/munin/create_snmp_links":
			source => "puppet://$servername/munin/create_snmp_links.sh",
			mode => 755, owner => root, group => root;
	}

	exec { "create_snmp_links":
		command => "${module_dir_path}/munin/create_snmp_links $NODESDIR",
		require => File["snmp_links"],
		timeout => "2048",
		schedule => daily
	}
}

define munin::apache_site()
{
	apache::site {
		$name:
			ensure => present,
			content => template("munin/site.conf")
	}
}