]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
add nagios_check_ssh_hostname to tweak the hostname which whould be monitored, as...
authormh <mh@immerda.ch>
Wed, 20 Oct 2010 19:17:16 +0000 (21:17 +0200)
committermh <mh@immerda.ch>
Wed, 20 Oct 2010 19:17:16 +0000 (21:17 +0200)
manifests/init.pp
manifests/nagios.pp

index 449f09fe7a1f2ed60d51558cfda9a5e89c5dbee2..54f822ae13e81a8c44e32776733285e594a71725 100644 (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
+          }
+        }
+      }
     }
   }
 
index 5a5a5edbba974969a3993fe7609df83a3ad9ef77..890810eff92fedc9bc3f67993a3c7ffec711e300 100644 (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}" } }
+  }
 }