From 6d978291639d6f0537581edef7db27939bd9411f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 3 Jun 2013 22:25:24 -0300 Subject: Cleaning up nodo::subsystem::monitor --- manifests/subsystem/monitor.pp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'manifests/subsystem/monitor.pp') diff --git a/manifests/subsystem/monitor.pp b/manifests/subsystem/monitor.pp index b57db9d..f38cffe 100644 --- a/manifests/subsystem/monitor.pp +++ b/manifests/subsystem/monitor.pp @@ -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", + } } - } -- cgit v1.2.3