nagios: Added support for defining ip address for nagios::host.
This commit is contained in:
parent
29700dace3
commit
e7ae4fb55b
1 changed files with 6 additions and 2 deletions
|
@ -419,6 +419,8 @@ define nagios::contact::pushover($token, $group=["all"],
|
||||||
#
|
#
|
||||||
# $name:
|
# $name:
|
||||||
# Hostname of target.
|
# Hostname of target.
|
||||||
|
# $address:
|
||||||
|
# IP address of target. Default is to use hostname.
|
||||||
# $group:
|
# $group:
|
||||||
# Hostgroup name.
|
# Hostgroup name.
|
||||||
# $osname:
|
# $osname:
|
||||||
|
@ -428,8 +430,9 @@ define nagios::contact::pushover($token, $group=["all"],
|
||||||
# $parent:
|
# $parent:
|
||||||
# Parent hostname.
|
# Parent hostname.
|
||||||
#
|
#
|
||||||
define nagios::host($group="NONE", $osname="NONE", $osicon="NONE",
|
define nagios::host($address=undef, $group="NONE", $osname="NONE",
|
||||||
$confdir=$nagios::common::confdir, $parent=undef) {
|
$osicon="NONE", $confdir=$nagios::common::confdir,
|
||||||
|
$parent=undef) {
|
||||||
|
|
||||||
file { "${confdir}/host_${name}.cfg":
|
file { "${confdir}/host_${name}.cfg":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
@ -441,6 +444,7 @@ define nagios::host($group="NONE", $osname="NONE", $osicon="NONE",
|
||||||
}
|
}
|
||||||
nagios_host { $name:
|
nagios_host { $name:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
address => $address,
|
||||||
use => "default",
|
use => "default",
|
||||||
target => "${confdir}/host_${name}.cfg",
|
target => "${confdir}/host_${name}.cfg",
|
||||||
parents => is_array($parent) ? {
|
parents => is_array($parent) ? {
|
||||||
|
|
Loading…
Add table
Reference in a new issue