1 |
class xymon { |
2 |
class client { |
3 |
package { xymon-client: } |
4 |
|
5 |
service { xymon-client: |
6 |
hasstatus => false, |
7 |
status => "/usr/lib64/xymon/client/runclient.sh status", |
8 |
require => Package['xymon-client'], |
9 |
} |
10 |
|
11 |
# TODO replace with a exported ressource |
12 |
$server = extlookup('hobbit_server','x') |
13 |
file { '/etc/sysconfig/xymon-client': |
14 |
content => template("xymon/xymon-client"), |
15 |
} |
16 |
} |
17 |
|
18 |
class server { |
19 |
package { ["xymon","fping"]: } |
20 |
|
21 |
service { xymon: |
22 |
ensure => running, |
23 |
path => '/etc/init.d/xymon', |
24 |
} |
25 |
|
26 |
File { |
27 |
group => xymon, |
28 |
require => Package["xymon"], |
29 |
notify => Exec["service xymon reload"], |
30 |
} |
31 |
|
32 |
file { |
33 |
# Environment variables user by hobbitd,hobbitlaunch,hobbitd_rrd,CGIs |
34 |
# and bbgen (which generates the static html pages) |
35 |
# hobbitlaunch (started by init script) may need to be restarted for |
36 |
# changes here, for hobbitd_rrd (e.g. TEST2RRD), it is sufficient to |
37 |
# kill hobbitd_rrd, hobbitlaunch will respawn it |
38 |
'/etc/xymon/hobbitserver.cfg': content => template("xymon/hobbitserver.cfg"); |
39 |
|
40 |
# Define hosts and web view layout, and lists tests to be run against |
41 |
# host by e.g. network tests from xymon server |
42 |
'/etc/xymon/bb-hosts': content => template("xymon/bb-hosts"); |
43 |
|
44 |
# Defines thresholds for test data reported by clients, e.g. load |
45 |
# disk, procs, ports, memory, as well as those which require some |
46 |
# configuration server side to the client: files, msgs, |
47 |
'/etc/xymon/hobbit-clients.cfg': content => template("xymon/hobbit-clients.cfg"); |
48 |
|
49 |
# Configuration for the xymon clients, which log files to process etc. |
50 |
'/etc/xymon/client-local.cfg': content => template("xymon/client-local.cfg"); |
51 |
|
52 |
# Used for alerting, changes should be taken into effect immediately |
53 |
'/etc/xymon/hobbit-alerts.cfg': content => template("xymon/hobbit-alerts.cfg"); |
54 |
} |
55 |
|
56 |
# Most changes should take effect immediately, but sometimes threshold |
57 |
# changes take effect sooner if hobbit is HUPd |
58 |
exec { "service xymon reload": |
59 |
refreshonly => true, |
60 |
require => Package["xymon"], |
61 |
} |
62 |
} |
63 |
} |