summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorandreas <andreas@immerda.ch>2008-04-12 08:09:54 +0000
committerandreas <andreas@immerda.ch>2008-04-12 08:09:54 +0000
commit303aaaf3e9335c0cc0f38b66c9ad4d9a62114538 (patch)
tree8ab81a9b9476d802b16ce5d735b97533e49f350b /manifests/init.pp
parentc0b40856b2a44c1fad50a1215de254bc8a5e144f (diff)
further changes ... still unfinished
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp26
1 files changed, 22 insertions, 4 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 416ac0d..1657f8c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -162,7 +162,7 @@ class nagios::base {
define host($ip = $fqdn, $short_alias = $fqdn) {
@@file {
- "$nagios_cfgdir/${name}_host.cfg":
+ "$nagios_cfgdir/hosts.d/${name}_host.cfg":
ensure => present, content => template( "nagios/host.erb" ),
mode => 644, owner => root, group => root,
tag => 'nagios'
@@ -184,7 +184,7 @@ class nagios::base {
default => $nagios2_description
}
@@file {
- "$nagios_cfgdir/${nagios2_host_name}_${name}_service.cfg":
+ "$nagios_cfgdir/hosts.d/${nagios2_host_name}_${name}_service.cfg":
ensure => present, content => template( "nagios/service.erb" ),
mode => 644, owner => root, group => root,
tag => 'nagios'
@@ -194,13 +194,31 @@ class nagios::base {
define extra_host($ip = $fqdn, $short_alias = $fqdn, $parent = "none") {
$nagios_parent = $parent
file {
- "$nagios_cfgdir/${name}_host.cfg":
+ "$nagios_cfgdir/hosts.d/${name}_host.cfg":
ensure => present, content => template( "nagios/host.erb" ),
mode => 644, owner => root, group => root,
notify => Service[nagios2],
}
}
- #
+
+ # additional hosts
+
+ file {
+ "$etc_nagios_path/hosts.cfg":
+ source => [
+ "puppet://$servername/files/nagios/hosts.cfg",
+ "puppet://$servername/nagios/hosts.cfg"
+ ],
+ mode => 0644, owner => nagios, group => nagios;
+ }
+
+ # nagios cfg includes $nagios_cfgdir/hosts.d
+ file {
+ "$etc_nagios_path/nagios.cfg":
+ ensure => present, content => template( "nagios/nagioscfg.erb" ),
+ mode => 0644, owner => nagios, group => nagios;
+ }
+
# include this class in every host that should be monitored by nagios
class target {
nagios2::host { $fqdn: }