diff --git a/manifests/client/target.pp b/manifests/client/target.pp index 49bea8a..7a3dbfb 100644 --- a/manifests/client/target.pp +++ b/manifests/client/target.pp @@ -12,7 +12,7 @@ class confdroid_nagios::client::target ( @@nagios_host { $fqdn: ensure => $ng_ping_ensure, - alias => $fqdn, + alias => $hostname, address => $fqdn, use => 'linux-server', target => $ng_target_host, @@ -24,7 +24,7 @@ class confdroid_nagios::client::target ( group => 'nagios', mode => '0640', check_command => "check_ping!${ng_ping_warn}!${ng_ping_crit}", - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } @@nagios_service { "root_partition_${fqdn}": diff --git a/manifests/nagios/objects/add_contact_rules.pp b/manifests/nagios/objects/add_contact_rules.pp index b09dda7..293c4ac 100644 --- a/manifests/nagios/objects/add_contact_rules.pp +++ b/manifests/nagios/objects/add_contact_rules.pp @@ -26,7 +26,7 @@ class confdroid_nagios::nagios::objects::add_contact_rules ( selrole => object_r, seltype => nagios_etc_t, seluser => system_u, - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } # manage file header diff --git a/manifests/nagios/objects/add_contactgroups_rules.pp b/manifests/nagios/objects/add_contactgroups_rules.pp index 2d9e7dc..3cc72d3 100644 --- a/manifests/nagios/objects/add_contactgroups_rules.pp +++ b/manifests/nagios/objects/add_contactgroups_rules.pp @@ -26,7 +26,7 @@ class confdroid_nagios::nagios::objects::add_contactgroups_rules ( selrole => object_r, seltype => nagios_etc_t, seluser => system_u, - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } # manage file header diff --git a/manifests/nagios/objects/add_hostgroup_rules.pp b/manifests/nagios/objects/add_hostgroup_rules.pp index e1f3851..1afe7ec 100644 --- a/manifests/nagios/objects/add_hostgroup_rules.pp +++ b/manifests/nagios/objects/add_hostgroup_rules.pp @@ -25,7 +25,7 @@ class confdroid_nagios::nagios::objects::add_hostgroup_rules ( selrole => object_r, seltype => nagios_etc_t, seluser => system_u, - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } # manage file header diff --git a/manifests/nagios/objects/add_servicegroup_rules.pp b/manifests/nagios/objects/add_servicegroup_rules.pp index 9181645..347d7d7 100644 --- a/manifests/nagios/objects/add_servicegroup_rules.pp +++ b/manifests/nagios/objects/add_servicegroup_rules.pp @@ -25,7 +25,7 @@ class confdroid_nagios::nagios::objects::add_servicegroup_rules ( selrole => object_r, seltype => nagios_etc_t, seluser => system_u, - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } # manage file header diff --git a/manifests/nagios/resources/resource.pp b/manifests/nagios/resources/resource.pp index 4136a72..aa08f2e 100644 --- a/manifests/nagios/resources/resource.pp +++ b/manifests/nagios/resources/resource.pp @@ -21,7 +21,7 @@ class confdroid_nagios::nagios::resources::resource ( selrole => object_r, seltype => nagios_etc_t, seluser => system_u, - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } concat::fragment { 'header': diff --git a/manifests/params.pp b/manifests/params.pp index 0739f2c..dd1e6c1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -183,7 +183,7 @@ class confdroid_nagios::params ( $os_release = $facts['os']['release']['major'] # service - $ng_nagios_service = 'nagios' + $ng_service = 'nagios' # directories $ng_main_dir = '/etc/nagios' @@ -238,7 +238,7 @@ class confdroid_nagios::params ( $ng_cntctgrps_head_erb = 'confdroid_nagios/nagios/contactgroups_cfg_head.erb' $ng_cntctgrps_rule_erb = 'confdroid_nagios/nagios/contactgroups_cfg_rule.erb' $ng_target_command = "${ng_conf_d_dir}/nagios_commands_base.cfg" - $ng_nagios_service_cmd = 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios' + $ng_service_cmd = 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios' $ng_htpasswd_file = "${ng_main_dir}/passwd" $ng_htpasswd_head = 'confdroid_nagios/nagios/htpasswd_head.erb' $ng_htpasswd_rule = 'confdroid_nagios/nagios/htpasswd_rule.erb' diff --git a/manifests/server/access.pp b/manifests/server/access.pp index daa24ab..9bd2cb3 100644 --- a/manifests/server/access.pp +++ b/manifests/server/access.pp @@ -17,7 +17,7 @@ define confdroid_nagios::server::access ( $ng_nagios_server = $confdroid_nagios::params::ng_nagios_server $ng_htpasswd_file = $confdroid_nagios::params::ng_htpasswd_file $ng_htpasswd_rule = $confdroid_nagios::params::ng_htpasswd_rule - $ng_nagios_service = $confdroid_nagios::params::ng_nagios_service + $ng_service = $confdroid_nagios::params::ng_service if $fqdn == $ng_nagios_server { # create password rules diff --git a/manifests/server/files.pp b/manifests/server/files.pp index 59d19b6..ab259e8 100644 --- a/manifests/server/files.pp +++ b/manifests/server/files.pp @@ -14,21 +14,7 @@ class confdroid_nagios::server::files ( group => 'nagios', mode => '0644', content => template($ng_nagios_cfg_erb), - notify => Service[$ng_nagios_service], + notify => Service[$ng_service], } - # custom cfg files - ## temp place holder, this will be done via defines - ## and PuppetDB exports and imports in the future - #file { $ng_target_command: - # ensure => file, - # owner => 'nagios', - # group => 'nagios', - # mode => '0644', - # selrange => s0, - # selrole => object_r, - # seltype => nagios_etc_t, - # seluser => system_u, - # notify => Service[$ng_nagios_service], - #} } } diff --git a/manifests/server/service.pp b/manifests/server/service.pp index 3b702b5..19c849b 100644 --- a/manifests/server/service.pp +++ b/manifests/server/service.pp @@ -17,9 +17,9 @@ class confdroid_nagios::server::service ( refreshonly => true, } - service { $ng_nagios_service: + service { $ng_service: ensure => running, - name => $ng_nagios_service, + name => $ng_service, enable => true, hasrestart => true, hasstatus => true, @@ -44,7 +44,7 @@ class confdroid_nagios::server::service ( } @@nagios_service { 'check_nagios_localhost': - check_command => $ng_nagios_service_cmd, + check_command => $ng_service_cmd, use => 'generic-service', host_name => 'localhost', notification_period => '24x7', @@ -197,7 +197,5 @@ class confdroid_nagios::server::service ( Nagios_contactgroup <<||>> { notify => Service['nagios'] } Nagios_command <<||>> { notify => Service['nagios'] } Nagios_timeperiod <<||>> { notify => Service['nagios'] } - - } } diff --git a/templates/nagios/cgi_cfg.erb b/templates/nagios/cgi_cfg.erb index a7745a6..d64f9db 100644 --- a/templates/nagios/cgi_cfg.erb +++ b/templates/nagios/cgi_cfg.erb @@ -22,7 +22,7 @@ default_user_name=<%= @ng_def_user_name %> authorized_for_system_information=<%= @ng_contact_name %>,<%= @ng_sysinfo_auth %> authorized_for_configuration_information=<%= @ng_contact_name %>,<%= @ng_confinfo_auth %> authorized_for_system_commands=<%= @ng_contact_name %>,<%= @ng_command_auth %> -authorized_for_all_services=<%= @ng_contact_name %>,<%= @ng_nagios_serviceview_auth %> +authorized_for_all_services=<%= @ng_contact_name %>,<%= @ng_serviceview_auth %> authorized_for_all_hosts=<%= @ng_contact_name %>,<%= @ng_hostview_auth %> authorized_for_all_service_commands=<%= @ng_contact_name %>,<%= @ng_svc_cmd_auth %> authorized_for_all_host_commands=<%= @ng_contact_name %>,<%= @ng_host_cmd_auth %> diff --git a/templates/nagios/svcgroups_cfg_rule.erb b/templates/nagios/svcgroups_cfg_rule.erb index 2df143d..4d5e62b 100644 --- a/templates/nagios/svcgroups_cfg_rule.erb +++ b/templates/nagios/svcgroups_cfg_rule.erb @@ -1,6 +1,6 @@ define servicegroup { - servicegroup_name <%= @ng_nagios_servicegroup_name %> - alias <%= @ng_nagios_servicegroup_alias %> - register <%= @ng_nagios_servicegroup_register %> + servicegroup_name <%= @ng_servicegroup_name %> + alias <%= @ng_servicegroup_alias %> + register <%= @ng_servicegroup_register %> } diff --git a/templates/nagios/templates_cfg_rule.erb b/templates/nagios/templates_cfg_rule.erb index dc0d626..7daa9ef 100644 --- a/templates/nagios/templates_cfg_rule.erb +++ b/templates/nagios/templates_cfg_rule.erb @@ -4,9 +4,9 @@ define <%= @ng_template_object %>{ name <%= @ng_template_object_name %> service_notification_period <%= @ng_svc_notification_period %> host_notification_period <%= @ng_host_notification_period %> - service_notification_options <%= @ng_nagios_service_notification_options %> + service_notification_options <%= @ng_service_notification_options %> host_notification_options <%= @ng_host_notification_options %> - service_notification_commands <%= @ng_nagios_service_notification_commands %> + service_notification_commands <%= @ng_service_notification_commands %> host_notification_commands <%= @ng_host_notification_commands %> register <%= @ng_object_register %> } @@ -114,7 +114,7 @@ define <%= @ng_template_object %>{ check_interval <%= @ng_check_interval %> retry_interval <%= @ng_retry_interval %> contact_groups <%= @ng_contact_groups %> - notification_options <%= @ng_nagios_service_notification_options %> + notification_options <%= @ng_service_notification_options %> notification_interval <%= @ng_notification_interval %> notification_period <%= @ng_notification_period %> register <%= @ng_object_register %>