nagios: Added parent host support to nagios::target.
This commit is contained in:
parent
20078c82ea
commit
f9e719d33e
2 changed files with 11 additions and 2 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue