diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/target.pp | 22 | ||||
-rw-r--r-- | manifests/target/fqdn.pp | 8 |
2 files changed, 18 insertions, 12 deletions
diff --git a/manifests/target.pp b/manifests/target.pp index f9b7e13..82cf6a1 100644 --- a/manifests/target.pp +++ b/manifests/target.pp @@ -1,22 +1,26 @@ -# manifests/target.pp - +# a simple nagios target to monitor class nagios::target( - $parents = 'absent', - $address = $::ipaddress, + $parents = 'absent', + $address = $::ipaddress, $nagios_alias = $::hostname, - $hostgroups = 'absent' + $hostgroups = 'absent', + $use = 'generic-host', ){ @@nagios_host { $::fqdn: address => $address, - alias => $nagios_alias, - use => 'generic-host', + alias => $nagios_alias, + use => $use, } if ($parents != 'absent') { - Nagios_host["${::fqdn}"] { parents => $parents } + Nagios_host[$::fqdn] { + parents => $parents + } } if ($hostgroups != 'absent') { - Nagios_host["${::fqdn}"] { hostgroups => $hostgroups } + Nagios_host[$::fqdn] { + hostgroups => $hostgroups + } } } diff --git a/manifests/target/fqdn.pp b/manifests/target/fqdn.pp index 6bb16c1..31fc4b7 100644 --- a/manifests/target/fqdn.pp +++ b/manifests/target/fqdn.pp @@ -1,10 +1,12 @@ +# monitor a host by fqdn class nagios::target::fqdn( + $address = $::fqdn, $hostgroups = 'absent', - $parents = 'absent' + $parents = 'absent' ) { class{'nagios::target': - address => $::fqdn, + address => $address, hostgroups => $hostgroups, - parents => $parents + parents => $parents } } |