]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Cleaning up nodo::subsystem::monitor
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 4 Jun 2013 01:25:24 +0000 (22:25 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 4 Jun 2013 01:25:24 +0000 (22:25 -0300)
manifests/subsystem/monitor.pp

index b57db9dadcbca0f70fca1d317bf7898778f15dd1..f38cffe1e25c1c5a90dd25eb4128bfccf1a9776b 100644 (file)
@@ -1,6 +1,8 @@
 class nodo::subsystem::monitor(
   $type       = 'vserver',
   $use_nagios = hiera('nodo::subsystem::monitor::use_nagios', True),
+  $check_ping = hiera('nodo::subsystem::monitor::check_ping', present),
+  $check_ssh  = hiera('nodo::subsystem::monitor::check_ssh',  absent),
   $address    = hiera('nodo::subsystem::monitor::address',    $::ipaddress),
   $ping_rate  = hiera('nodo::subsystem::monitor::ping_rate', '!100.0,20%!500.0,60%')
 ) {
@@ -9,21 +11,22 @@ class nodo::subsystem::monitor(
 
     if $type == 'vserver' {
       include nagios::target::fqdn
-      nagios::service::ping { "${::fqdn}":
-        ping_rate => $ping_rate,
-      }
     }
 
     if $type == 'host' {
       class{ 'nagios::target':
         address => $address,
       }
+    }
 
-      nagios::service::ping { "$address":
-        ping_rate => $ping_rate,
-      }
+    nagios::service::ping { "${::fqdn}":
+      ensure    => $check_ping,
+      ping_rate => $ping_rate,
     }
 
+    nagios::service { "check_ssh4":
+      ensure        => $check_ssh,
+      check_command => "check_ssh_4",
+    }
   }
-
 }