summaryrefslogtreecommitdiff
path: root/manifests/target.pp
blob: f9b7e1359e30318b81f9aa334b91ac7bce4696c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# manifests/target.pp

class nagios::target(
  $parents = 'absent',
  $address = $::ipaddress,
  $nagios_alias = $::hostname,
  $hostgroups = 'absent'
){
  @@nagios_host { $::fqdn:
    address => $address,
    alias => $nagios_alias,
    use => 'generic-host',
  }

  if ($parents != 'absent') {
    Nagios_host["${::fqdn}"] { parents => $parents }
  }

  if ($hostgroups != 'absent') {
    Nagios_host["${::fqdn}"] { hostgroups => $hostgroups }  
  }
}