Allow manual definition of nagios host groups
This commit is contained in:
parent
0dc654e4ca
commit
8b70966a7d
1 changed files with 17 additions and 2 deletions
|
@ -1,9 +1,24 @@
|
||||||
# Configure nagios target.
|
# Configure nagios target.
|
||||||
#
|
#
|
||||||
|
# === Global variables
|
||||||
|
#
|
||||||
|
# $nagios_target_group:
|
||||||
|
# Host and service group name. Defaults to $domain.
|
||||||
|
#
|
||||||
class nagios::target {
|
class nagios::target {
|
||||||
|
|
||||||
|
if $nagios_target_group {
|
||||||
|
$group = $nagios_target_group
|
||||||
|
} else {
|
||||||
|
if $::domain {
|
||||||
|
$group = $::domain
|
||||||
|
} else {
|
||||||
|
$group = "unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@nagios::host { $::homename:
|
@@nagios::host { $::homename:
|
||||||
group => $::domain,
|
group => $group,
|
||||||
osname => $::operatingsystem,
|
osname => $::operatingsystem,
|
||||||
osicon => $::osfamily ? {
|
osicon => $::osfamily ? {
|
||||||
"" => "NONE",
|
"" => "NONE",
|
||||||
|
@ -13,7 +28,7 @@ class nagios::target {
|
||||||
|
|
||||||
Nagios::Service {
|
Nagios::Service {
|
||||||
host => $::homename,
|
host => $::homename,
|
||||||
group => $::domain,
|
group => $group,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue