2010-10-20 21:17:16 +02:00
|
|
|
define sshd::nagios(
|
2010-10-20 23:12:43 +02:00
|
|
|
$port = 'absent',
|
2010-10-20 22:57:15 +02:00
|
|
|
$ensure = 'present',
|
2010-10-20 21:17:16 +02:00
|
|
|
$check_hostname = 'absent'
|
|
|
|
) {
|
2010-10-20 23:12:43 +02:00
|
|
|
$real_port = $port ? {
|
|
|
|
'absent' => $name,
|
2013-02-03 00:30:54 +01:00
|
|
|
default => $port,
|
2010-10-20 23:12:43 +02:00
|
|
|
}
|
2010-10-20 21:17:16 +02:00
|
|
|
case $check_hostname {
|
2010-10-20 22:57:15 +02:00
|
|
|
'absent': {
|
|
|
|
nagios::service{"ssh_port_${name}":
|
2013-02-03 00:30:54 +01:00
|
|
|
ensure => $ensure,
|
2012-06-05 23:23:03 +02:00
|
|
|
check_command => "check_ssh_port!${real_port}"
|
2010-10-20 22:57:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
default: {
|
2010-10-20 23:12:43 +02:00
|
|
|
nagios::service{"ssh_port_host_${name}":
|
2013-02-03 00:30:54 +01:00
|
|
|
ensure => $ensure,
|
2010-10-21 02:49:11 +02:00
|
|
|
check_command => "check_ssh_port_host!${real_port}!${check_hostname}"
|
2010-10-20 22:57:15 +02:00
|
|
|
}
|
|
|
|
}
|
2010-10-20 21:17:16 +02:00
|
|
|
}
|
2010-10-20 20:56:15 +02:00
|
|
|
}
|