diff --git a/nagios/manifests/init.pp b/nagios/manifests/init.pp index 1288f1e..e5b61e4 100644 --- a/nagios/manifests/init.pp +++ b/nagios/manifests/init.pp @@ -425,9 +425,11 @@ define nagios::contact::pushover($token, $group=["all"], # Operating system name for hostextinfo. # $osicon: # Operating system icon name for hostextinfo. +# $parent: +# Parent hostname. # define nagios::host($group="NONE", $osname="NONE", $osicon="NONE", - $confdir=$nagios::common::confdir) { + $confdir=$nagios::common::confdir, $parent=undef) { file { "${confdir}/host_${name}.cfg": ensure => present, @@ -501,6 +503,7 @@ define nagios::host($group="NONE", $osname="NONE", $osicon="NONE", Nagios_Host[$name] { contact_groups => "all,${group}", hostgroups => $group, + parents => $parent, } } diff --git a/nagios/manifests/target.pp b/nagios/manifests/target.pp index 2cd146f..612ebc0 100644 --- a/nagios/manifests/target.pp +++ b/nagios/manifests/target.pp @@ -1,11 +1,16 @@ # Configure nagios target. # +# === Parameters +# +# $parent: +# Parent hostname. +# # === Global variables # # $nagios_target_group: # Host and service group name. Defaults to $domain. # -class nagios::target { +class nagios::target($parent=undef) { if $nagios_target_group { $group = $nagios_target_group @@ -24,6 +29,7 @@ class nagios::target { "" => "NONE", default => inline_template("<%= osfamily.downcase %>") }, + parent => $parent, } Nagios::Service {