nagios: Added TCP connect check support.
This commit is contained in:
parent
de46a6c4a4
commit
e784e03300
1 changed files with 36 additions and 0 deletions
|
@ -100,6 +100,42 @@ class nagios::target::smtp inherits nagios::target {
|
|||
}
|
||||
|
||||
|
||||
# Configure tcp connect service target.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# Short name
|
||||
# $port:
|
||||
# Port where to connect
|
||||
# $description:
|
||||
# Description of service. Defaults to $name
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
# nagios::target::tcp { "git":
|
||||
# port => "9418",
|
||||
# description => "GIT",
|
||||
# }
|
||||
#
|
||||
define nagios::target::tcp($port, $description=undef) {
|
||||
|
||||
include nagios::target
|
||||
|
||||
if ! $description {
|
||||
$description = $name
|
||||
}
|
||||
|
||||
@@nagios::service { "${::homename}_${name}":
|
||||
command => "check_tcp!${port}",
|
||||
description => $description,
|
||||
group => $nagios::target::group,
|
||||
host => $::homename,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Configure nagios nrpe target.
|
||||
#
|
||||
class nagios::target::nrpe inherits nagios::target {
|
||||
|
|
Loading…
Add table
Reference in a new issue