aboutsummaryrefslogtreecommitdiffstats
path: root/modules/xymon
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-01-08 22:24:45 +0000
committerMichael Scherer <misc@mageia.org>2012-01-08 22:24:45 +0000
commita48ad1c35ad53e8bbdd2d6b72c6cb7f6d444e7d9 (patch)
tree385c82b744f7fbb55233a9cb2f3db66a39761c0c /modules/xymon
parent86f27423aa7c86c570031aeab3bd173af20194d9 (diff)
downloadpuppet-a48ad1c35ad53e8bbdd2d6b72c6cb7f6d444e7d9.tar
puppet-a48ad1c35ad53e8bbdd2d6b72c6cb7f6d444e7d9.tar.gz
puppet-a48ad1c35ad53e8bbdd2d6b72c6cb7f6d444e7d9.tar.bz2
puppet-a48ad1c35ad53e8bbdd2d6b72c6cb7f6d444e7d9.tar.xz
puppet-a48ad1c35ad53e8bbdd2d6b72c6cb7f6d444e7d9.zip
refactoring of xymon module
Diffstat (limited to 'modules/xymon')
-rw-r--r--modules/xymon/manifests/init.pp131
1 files changed, 47 insertions, 84 deletions
diff --git a/modules/xymon/manifests/init.pp b/modules/xymon/manifests/init.pp
index 3a3a2a51..826812e0 100644
--- a/modules/xymon/manifests/init.pp
+++ b/modules/xymon/manifests/init.pp
@@ -1,100 +1,63 @@
class xymon {
-
class client {
- package { xymon-client:
- ensure => installed,
- }
+ package { xymon-client: }
- service { xymon-client:
- ensure => running,
- path => '/etc/init.d/xymon-client',
+ service { xymon-client:
+ ensure => running,
+ path => '/etc/init.d/xymon-client',
require => Package['xymon-client'],
- }
+ }
# TODO replace with a exported ressource
$server = extlookup('hobbit_server','x')
- file { '/etc/sysconfig/xymon-client':
- content => template("xymon/xymon-client"),
- }
+ 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"),
- }
+ package { ["xymon","fping"]: }
+
+ service { xymon:
+ ensure => running,
+ path => '/etc/init.d/xymon',
+ }
+
+ File {
+ group => xymon,
+ require => Package["xymon"],
+ notify => Exec["service xymon reload"],
+ }
+
+ file {
+ # 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
+ '/etc/xymon/hobbitserver.cfg': 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
+ '/etc/xymon/bb-hosts': 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"),
- }
+ # 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,
+ '/etc/xymon/hobbit-clients.cfg': content => template("xymon/hobbit-clients.cfg");
+
+ # Configuration for the xymon clients, which log files to process etc.
+ '/etc/xymon/client-local.cfg': content => template("xymon/client-local.cfg");
+
+ # Used for alerting, changes should be taken into effect immediately
+ '/etc/xymon/hobbit-alerts.cfg': content => template("xymon/hobbit-alerts.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":
+ # 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"],
- ]
+ require => Package["xymon"],
}
}
}