aboutsummaryrefslogtreecommitdiffstats
path: root/modules/xymon/manifests/init.pp
blob: 487ff97993ce87d1ba91d26addb3fbd8ea49db55 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class xymon {

    class client {
	package { xymon-client:
	    ensure => installed,
	}
	service { xymon-client:
	    ensure => running,
	    path => '/etc/init.d/xymon-client',
	}
        # TODO replace with a exported ressource
        $server = extlookup('hobbit_server','x')
	file { '/etc/sysconfig/xymon-client':
	    content => template("xymon/xymon-client"),
	}
    }

    class server {
	$package_list = ["xymon","fping"]
	package { $package_list:
	    ensure => installed,
	}
	service { xymon:
	    ensure => running,
	    path => '/etc/init.d/xymon',
	}
	# Environment variables user by hobbitd,hobbitlaunch,hobbitd_rrd,CGIs
	# and bbgen (which generates the static html pages)
	# hobbitlaunch (started by init script) may need to be restarted for
	# changes here, for hobbitd_rrd (e.g. TEST2RRD), it is sufficient to
	# kill hobbitd_rrd, hobbitlaunch will respawn it
	file { '/etc/xymon/hobbitserver.cfg':
	    ensure => present,
	    owner => root,
	    group => xymon,
	    mode => 644,
	    require => Package["xymon"],
	    notify => Service["xymon"],
	    content => template("xymon/hobbitserver.cfg"),
	}
	# Define hosts and web view layout, and lists tests to be run against
	# host by e.g. network tests from xymon server
	file {'/etc/xymon/bb-hosts':
	    ensure => present,
	    owner => root,
	    group => xymon,
	    mode => 644,
	    require => Package["xymon"],
	    content => template("xymon/bb-hosts"),
	}

	# Defines thresholds for test data reported by clients, e.g. load
	# disk, procs, ports, memory, as well as those which require some
	# configuration server side to the client: files, msgs, 
	file { 'hobbit-clients.cfg':
	    path => '/etc/xymon/hobbit-clients.cfg',
	    ensure => present,
	    owner => root,
	    group => xymon,
	    mode => 644,
	    require => Package["xymon"],
	    content => template("xymon/hobbit-clients.cfg"),
	}
	# Configuration for the xymon clients, which log files to process etc.
	file {'client-local.cfg':
	    path => '/etc/xymon/client-local.cfg',
	    ensure => present,
	    owner => root,
	    group => xymon,
	    mode => 644,
	    require => Package["xymon"],
	    content => template("xymon/client-local.cfg"),
	}

	# Used for alerting, changes should be taken into effect immediately
	file {'hobbit-alerts.cfg':
	    path => '/etc/xymon/hobbit-alerts.cfg',
	    ensure => present,
	    owner => root,
	    group => xymon,
	    mode => 644,
	    require => Package["xymon"],
	    content => template("xymon/hobbit-alerts.cfg"),
	}
	# Most changes should take effect immediately, but sometimes threshold
	# changes take effect sooner if hobbit is HUPd
	exec { "service xymon reload":
            refreshonly => true,
	    require => Package["xymon"],
            subscribe => [ 
		File["hobbit-clients.cfg"],
		File["hobbit-alerts.cfg"],
		File["client-local.cfg"],
	    ]
        }
    }
}