module-sshd/manifests/nagios.pp

25 lines
552 B
ObjectPascal
Raw Normal View History

define sshd::nagios(
$port = 'absent',
2010-10-20 22:57:15 +02:00
$ensure = 'present',
$check_hostname = 'absent'
) {
$real_port = $port ? {
'absent' => $name,
2013-02-03 00:30:54 +01:00
default => $port,
}
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: {
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 20:56:15 +02:00
}