add nagios_check_ssh_hostname to tweak the hostname which whould be monitored, as this one might actually differ

This commit is contained in:
mh 2010-10-20 21:17:16 +02:00
parent 988a88f4e6
commit d0d3d20e14
2 changed files with 17 additions and 5 deletions

View file

@ -201,8 +201,7 @@ class sshd {
}
if $sshd_port != '' {
$sshd_ports = [ $sshd_port ]
}
elsif ! $sshd_ports {
} elsif ! $sshd_ports {
$sshd_ports = [ 22 ]
}
case $sshd_authorized_keys_file {
@ -235,7 +234,15 @@ class sshd {
if $use_nagios {
case $nagios_check_ssh {
false: { info("We don't do nagioschecks for ssh on ${fqdn}" ) }
default: { sshd::nagios{$sshd_ports:} }
default: {
sshd::nagios{$sshd_ports:
check_hostname => $nagios_check_ssh_hostname ? {
'' => 'absent',
undef => 'absent',
default => $nagios_check_ssh_hostname
}
}
}
}
}

View file

@ -1,3 +1,8 @@
define sshd::nagios {
nagios::service{ "ssh_port_${name}": check_command => "check_ssh_port!$name" }
define sshd::nagios(
$check_hostname = 'absent'
) {
case $check_hostname {
'absent': { nagios::service{ "ssh_port_${name}": check_command => "check_ssh_port!$name" } }
default: { nagios::service{"ssh_port_host_${name}_${check_hostname}": check_command => "check_ssh_port_host!${name}!${check_hostname}" } }
}
}