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