diff --git a/manifests/params.pp b/manifests/params.pp index 8a539d9..e6a8966 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -183,6 +183,26 @@ # @param [String] ng_ochp_timeout The OCHP timeout for Nagios. Default is '5'. # @param [String] ng_perfdata_timeout The performance data timeout for Nagios. # Default is '5'. +# @param [String] ng_retain_state_inf Whether to retain state information in +# Nagios. Default is '1'. +# @param [String] ng_retention_update_intval The retention update interval for +# Nagios. Default is '60'. +# @param [String] ng_use_ret_program_state Whether to use the retention program +# state in Nagios. Default is '1'. +# @param [String] ng_use_ret_scheduling_info Whether to use retained scheduling +# info in Nagios. Default is '1'. +# @param [String] ng_ret_host_attr_mask The retention host attribute mask for +# Nagios. Default is '0'. +# @param [String] ng_ret_service_attr_mask The retention service attribute mask +# for Nagios. Default is '0'. +# @param [String] ng_ret_proc_host_attr_mask The retention process host +# attribute mask for Nagios. Default is '0'. +# @param [String] ng_ret_proc_svc_attr_mask The retention process service +# attribute mask for Nagios. Default is '0'. +# @param [String] ng_ret_contact_h_attr_mask The retention contact host +# attribute mask for Nagios. Default is '0'. +# @param [String] ng_ret_contact_s_attr_mask The retention contact service +# attribute mask for Nagios. Default is '0'. ################################################################################ class confdroid_nagios::params ( @@ -258,6 +278,16 @@ class confdroid_nagios::params ( String $ng_ocsp_timeout = '5', String $ng_ochp_timeout = '5', String $ng_perfdata_timeout = '5', + String $ng_retain_state_inf = '1', + String $ng_retention_update_intval = '60', + String $ng_use_ret_program_state = '1', + String $ng_use_ret_scheduling_info = '1', + String $ng_ret_host_attr_mask = '0', + String $ng_ret_service_attr_mask = '0', + String $ng_ret_proc_host_attr_mask = '0', + String $ng_ret_proc_svc_attr_mask = '0', + String $ng_ret_contact_h_attr_mask = '0', + String $ng_ret_contact_s_attr_mask = '0', # cgi.cfg String $ng_context_help = '1', @@ -377,6 +407,7 @@ class confdroid_nagios::params ( $ng_lock_file = "${ng_run_dir}/nagios.pid" $ng_temp_file = "${ng_spool_dir}/nagios.tmp" $ng_check_result_path = "${ng_spool_dir}/checkresults" + $ng_state_retention_file = "${ng_spool_dir}/retention.dat" ## old $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb' diff --git a/templates/nagios/nagios_cfg.erb b/templates/nagios/nagios_cfg.erb index 2dfc888..0003d02 100644 --- a/templates/nagios/nagios_cfg.erb +++ b/templates/nagios/nagios_cfg.erb @@ -49,6 +49,7 @@ event_broker_options=<%= @ng_event_broker_options %> broker_module=<%= broker_module %> <% end end -%> +# LOG settings log_rotation_method=<%= @ng_log_rotation_method %> log_archive_path=<%= @ng_log_archives %> use_syslog=<%= @ng_use_syslog %> @@ -97,6 +98,7 @@ auto_reschedule_checks=<%= @ng_auto_reschedule_checks %> auto_rescheduling_interval=<%= @ng_auto_reschedule_intval %> auto_rescheduling_window=<%= @ng_auto_reschedule_window %> +# TIMEOUTS service_check_timeout=<%= @ng_service_check_timeout %> host_check_timeout=<%= @ng_host_check_timeout %> event_handler_timeout=<%= @ng_event_handler_timeout %> @@ -105,98 +107,18 @@ ocsp_timeout=<%= @ng_ocsp_timeout %> ochp_timeout=<%= @ng_ochp_timeout %> perfdata_timeout=<%= @ng_perfdata_timeout %> -# RETAIN STATE INFORMATION -# This setting determines whether or not Nagios will save state -# information for services and hosts before it shuts down. Upon -# startup Nagios will reload all saved service and host state -# information before starting to monitor. This is useful for -# maintaining long-term data on state statistics, etc, but will -# slow Nagios down a bit when it (re)starts. Since its only -# a one-time penalty, I think its well worth the additional -# startup delay. - -retain_state_information=1 - - - -# STATE RETENTION FILE -# This is the file that Nagios should use to store host and -# service state information before it shuts down. The state -# information in this file is also read immediately prior to -# starting to monitor the network when Nagios is restarted. -# This file is used only if the retain_state_information -# variable is set to 1. - -state_retention_file=/var/spool/nagios/retention.dat - - - -# RETENTION DATA UPDATE INTERVAL -# This setting determines how often (in minutes) that Nagios -# will automatically save retention data during normal operation. -# If you set this value to 0, Nagios will not save retention -# data at regular interval, but it will still save retention -# data before shutting down or restarting. If you have disabled -# state retention, this option has no effect. - -retention_update_interval=60 - - - -# USE RETAINED PROGRAM STATE -# This setting determines whether or not Nagios will set -# program status variables based on the values saved in the -# retention file. If you want to use retained program status -# information, set this value to 1. If not, set this value -# to 0. - -use_retained_program_state=1 - - - -# USE RETAINED SCHEDULING INFO -# This setting determines whether or not Nagios will retain -# the scheduling info (next check time) for hosts and services -# based on the values saved in the retention file. If you -# If you want to use retained scheduling info, set this -# value to 1. If not, set this value to 0. - -use_retained_scheduling_info=1 - - - -# RETAINED ATTRIBUTE MASKS (ADVANCED FEATURE) -# The following variables are used to specify specific host and -# service attributes that should *not* be retained by Nagios during -# program restarts. -# -# The values of the masks are bitwise ANDs of values specified -# by the "MODATTR_" definitions found in include/common.h. -# For example, if you do not want the current enabled/disabled state -# of flap detection and event handlers for hosts to be retained, you -# would use a value of 24 for the host attribute mask... -# MODATTR_EVENT_HANDLER_ENABLED (8) + MODATTR_FLAP_DETECTION_ENABLED (16) = 24 - -# This mask determines what host attributes are not retained -retained_host_attribute_mask=0 - -# This mask determines what service attributes are not retained -retained_service_attribute_mask=0 - -# These two masks determine what process attributes are not retained. -# There are two masks, because some process attributes have host and service -# options. For example, you can disable active host checks, but leave active -# service checks enabled. -retained_process_host_attribute_mask=0 -retained_process_service_attribute_mask=0 - -# These two masks determine what contact attributes are not retained. -# There are two masks, because some contact attributes have host and -# service options. For example, you can disable host notifications for -# a contact, but leave service notifications enabled for them. -retained_contact_host_attribute_mask=0 -retained_contact_service_attribute_mask=0 - +# RETENTION AND INTERVAL OPTIONS +retain_state_information=<%= @ng_retain_state_inf %> +state_retention_file=<%= @ng_state_retention_file %> +retention_update_interval=<%= @ng_retention_update_intval %> +use_retained_program_state=<%= @ng_use_ret_program_state %> +use_retained_scheduling_info=<%= @ng_use_ret_scheduling_info %> +retained_host_attribute_mask=<%= @ng_ret_host_attr_mask %> +retained_service_attribute_mask=<%= @ng_ret_service_attr_mask %> +retained_process_host_attribute_mask=<%= @ng_ret_proc_host_attr_mask %> +retained_process_service_attribute_mask=<%= @ng_ret_proc_svc_attr_mask %> +retained_contact_host_attribute_mask=<%= @ng_ret_contact_h_attr_mask %> +retained_contact_service_attribute_mask=<%= @ng_ret_contact_s_attr_mask %> # INTERVAL LENGTH