diff --git a/manifests/main/config.pp b/manifests/main/config.pp index a89ca93..469dd78 100644 --- a/manifests/main/config.pp +++ b/manifests/main/config.pp @@ -10,7 +10,7 @@ class confdroid_nagios::main::config ( include confdroid_nagios::server::service } - if $fqdn != $ng_nagios_server { + if $ng_enable_target == true { include confdroid_nagios::client::target } } diff --git a/manifests/server/service.pp b/manifests/server/service.pp index 8930f23..1e205c2 100644 --- a/manifests/server/service.pp +++ b/manifests/server/service.pp @@ -27,6 +27,23 @@ class confdroid_nagios::server::service ( require => Exec['ng_restart_httpd'], } + @@nagios_host { 'localhost': + ensure => $ng_ping_ensure, + alias => 'localhost', + address => '127.0.0.1', + use => 'linux-server', + target => $ng_target_localhost, + hostgroups => 'linux-servers', + contacts => $ng_contact_name, + max_check_attempts => $ng_max_check_attempts, + notification_period => '24x7', + owner => $ng_user, + group => $ng_user, + mode => '0640', + check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}", + notify => Service[$ng_service], + } + resources { ['nagios_host', 'nagios_hostgroup', 'nagios_hostdependency', @@ -59,6 +76,5 @@ class confdroid_nagios::server::service ( Nagios_contactgroup <<||>> { notify => Service['nagios'] } Nagios_command <<||>> { notify => Service['nagios'] } Nagios_timeperiod <<||>> { notify => Service['nagios'] } - } }