Fixed and enabled nagios hostextinfo

This commit is contained in:
Ossi Salmi 2012-11-17 13:36:05 +02:00
parent 1d948bc6a0
commit 801356262b

View file

@ -272,7 +272,7 @@ define nagios::contact::prowl($confdir=$nagios::server::confdir) {
} }
define nagios::host($confdir, $operatingsystem) { define nagios::host($confdir, $osname, $osicon) {
file { "${confdir}/host_${name}.cfg": file { "${confdir}/host_${name}.cfg":
ensure => present, ensure => present,
@ -288,21 +288,31 @@ define nagios::host($confdir, $operatingsystem) {
target => "${confdir}/host_${name}.cfg" target => "${confdir}/host_${name}.cfg"
} }
# file { "${confdir}/hostextinfo_${name}.cfg": if $osicon != "NONE" {
# ensure => present, case $::operatingsystem {
# mode => "0640", "debian","ubuntu": {
# owner => "root", $iconpath = "base/"
# group => "nagios", }
# before => Nagios_Hostextinfo[$name], default: {
# require => File["/etc/nagios/conf.d"], $iconpath = ""
# } }
# nagios_hostextinfo { $name: }
# ensure => present, file { "${confdir}/hostextinfo_${name}.cfg":
# icon_image_alt => $operatingsystem, ensure => present,
# icon_image => "base/${operatingsystem}.png", mode => "0640",
# statusmap_image => "base/${operatingsystem}.gd2", owner => "root",
# target => "${confdir}/hostextinfo_${name}.cfg" group => "nagios",
# } before => Nagios_Hostextinfo[$name],
require => File["/etc/nagios/conf.d"],
}
nagios_hostextinfo { $name:
ensure => present,
icon_image_alt => $osname,
icon_image => "${iconpath}${osicon}.png",
statusmap_image => "${iconpath}${osicon}.gd2",
target => "${confdir}/hostextinfo_${name}.cfg"
}
}
} }
@ -331,7 +341,11 @@ define nagios::service($confdir, $host, $command, $description) {
class nagios::target { class nagios::target {
@@nagios::host { $fqdn: @@nagios::host { $fqdn:
operatingsystem => inline_template("<%= operatingsystem.downcase %>") osname => $::operatingsystem,
osicon => $::osfamily ? {
"" => "NONE",
default => inline_template("<%= osfamily.downcase %>")
},
} }
} }