nagios: Added support for defining ip address for nagios::host.

This commit is contained in:
Timo Mkinen 2013-05-10 12:12:17 +03:00
parent 29700dace3
commit e7ae4fb55b

View file

@ -419,6 +419,8 @@ define nagios::contact::pushover($token, $group=["all"],
#
# $name:
# Hostname of target.
# $address:
# IP address of target. Default is to use hostname.
# $group:
# Hostgroup name.
# $osname:
@ -428,8 +430,9 @@ define nagios::contact::pushover($token, $group=["all"],
# $parent:
# Parent hostname.
#
define nagios::host($group="NONE", $osname="NONE", $osicon="NONE",
$confdir=$nagios::common::confdir, $parent=undef) {
define nagios::host($address=undef, $group="NONE", $osname="NONE",
$osicon="NONE", $confdir=$nagios::common::confdir,
$parent=undef) {
file { "${confdir}/host_${name}.cfg":
ensure => present,
@ -441,6 +444,7 @@ define nagios::host($group="NONE", $osname="NONE", $osicon="NONE",
}
nagios_host { $name:
ensure => present,
address => $address,
use => "default",
target => "${confdir}/host_${name}.cfg",
parents => is_array($parent) ? {