summaryrefslogtreecommitdiff
path: root/puppet/modules/sshd/manifests/nagios.pp
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/sshd/manifests/nagios.pp')
m---------puppet/modules/sshd0
-rw-r--r--puppet/modules/sshd/manifests/nagios.pp24
2 files changed, 24 insertions, 0 deletions
diff --git a/puppet/modules/sshd b/puppet/modules/sshd
deleted file mode 160000
-Subproject 76f4f872f81209a52df2205fd88b5619df58f00
diff --git a/puppet/modules/sshd/manifests/nagios.pp b/puppet/modules/sshd/manifests/nagios.pp
new file mode 100644
index 00000000..6921de91
--- /dev/null
+++ b/puppet/modules/sshd/manifests/nagios.pp
@@ -0,0 +1,24 @@
+define sshd::nagios(
+ $port = 'absent',
+ $ensure = 'present',
+ $check_hostname = 'absent'
+) {
+ $real_port = $port ? {
+ 'absent' => $name,
+ default => $port,
+ }
+ case $check_hostname {
+ 'absent': {
+ nagios::service{"ssh_port_${name}":
+ ensure => $ensure,
+ check_command => "check_ssh_port!${real_port}"
+ }
+ }
+ default: {
+ nagios::service{"ssh_port_host_${name}":
+ ensure => $ensure,
+ check_command => "check_ssh_port_host!${real_port}!${check_hostname}"
+ }
+ }
+ }
+}