From b59371333fd45c94411e6e40fccd6d1f047768f8 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Sat, 7 Mar 2026 12:15:18 +0100 Subject: [PATCH] OP#436 more controls --- manifests/params.pp | 16 +++++++ templates/nagios/nagios_cfg.erb | 80 +++------------------------------ 2 files changed, 22 insertions(+), 74 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 0432a91..2ee2206 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -151,6 +151,16 @@ # Nagios. Default is '10'. # @param [String] ng_max_check_res_reap_time The maximum check result reaper time # for Nagios. Default is '30'. +# @param [String] ng_max_check_res_file_age The maximum check result file age for +# Nagios. Default is '3600'. +# @param [String] ng_cached_h_check_horizon The cached host check horizon for +# Nagios. Default is '15'. +# @param [String] ng_cached_s_check_horizon The cached service check horizon for +# Nagios. Default is '15'. +# @param [String] ng_pred_host_dep_checks Whether to enable predictive host +# dependency checks in Nagios. Default is '1'. +# @param [String] ng_pred_svc_dep_checks Whether to enable predictive service +# dependency checks in Nagios. Default is '1'. ################################################################################ class confdroid_nagios::params ( @@ -209,6 +219,11 @@ class confdroid_nagios::params ( String $ng_max_concurrent_checks = '0', String $ng_check_res_reaper_freq = '10', String $ng_max_check_res_reap_time = '30', + String $ng_max_check_res_file_age = '3600', + String $ng_cached_h_check_horizon = '15', + String $ng_cached_s_check_horizon = '15', + String $ng_pred_host_dep_checks = '1', + String $ng_pred_svc_dep_checks = '1', # cgi.cfg String $ng_context_help = '1', @@ -327,6 +342,7 @@ class confdroid_nagios::params ( $ng_command_file = "${ng_cmd_dir}/nagios.cmd" $ng_lock_file = "${ng_run_dir}/nagios.pid" $ng_temp_file = "${ng_spool_dir}/nagios.tmp" + $ng_check_result_path = "${ng_spool_dir}/checkresults" ## old $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb' diff --git a/templates/nagios/nagios_cfg.erb b/templates/nagios/nagios_cfg.erb index 895bd04..81b7c16 100644 --- a/templates/nagios/nagios_cfg.erb +++ b/templates/nagios/nagios_cfg.erb @@ -82,81 +82,13 @@ max_concurrent_checks=<%= @ng_max_concurrent_checks %> check_result_reaper_frequency=<%= @ng_check_res_reaper_freq %> max_check_result_reaper_time=<%= @ng_max_check_res_reap_time %> +check_result_path=<%= @ng_check_result_path %> +max_check_result_file_age=<%= @ng_max_check_res_file_age %> +cached_host_check_horizon=<%= @ng_cached_h_check_horizon %> +cached_service_check_horizon=<%= @ng_cached_s_check_horizon %> - -# CHECK RESULT PATH -# This is directory where Nagios stores the results of host and -# service checks that have not yet been processed. -# -# Note: Make sure that only one instance of Nagios has access -# to this directory! - -check_result_path=/var/spool/nagios/checkresults - - - - -# MAX CHECK RESULT FILE AGE -# This option determines the maximum age (in seconds) which check -# result files are considered to be valid. Files older than this -# threshold will be mercilessly deleted without further processing. - -max_check_result_file_age=3600 - - - - -# CACHED HOST CHECK HORIZON -# This option determines the maximum amount of time (in seconds) -# that the state of a previous host check is considered current. -# Cached host states (from host checks that were performed more -# recently that the timeframe specified by this value) can immensely -# improve performance in regards to the host check logic. -# Too high of a value for this option may result in inaccurate host -# states being used by Nagios, while a lower value may result in a -# performance hit for host checks. Use a value of 0 to disable host -# check caching. - -cached_host_check_horizon=15 - - - -# CACHED SERVICE CHECK HORIZON -# This option determines the maximum amount of time (in seconds) -# that the state of a previous service check is considered current. -# Cached service states (from service checks that were performed more -# recently that the timeframe specified by this value) can immensely -# improve performance in regards to predictive dependency checks. -# Use a value of 0 to disable service check caching. - -cached_service_check_horizon=15 - - - -# ENABLE PREDICTIVE HOST DEPENDENCY CHECKS -# This option determines whether or not Nagios will attempt to execute -# checks of hosts when it predicts that future dependency logic test -# may be needed. These predictive checks can help ensure that your -# host dependency logic works well. -# Values: -# 0 = Disable predictive checks -# 1 = Enable predictive checks (default) - -enable_predictive_host_dependency_checks=1 - - - -# ENABLE PREDICTIVE SERVICE DEPENDENCY CHECKS -# This option determines whether or not Nagios will attempt to execute -# checks of service when it predicts that future dependency logic test -# may be needed. These predictive checks can help ensure that your -# service dependency logic works well. -# Values: -# 0 = Disable predictive checks -# 1 = Enable predictive checks (default) - -enable_predictive_service_dependency_checks=1 - +enable_predictive_host_dependency_checks=<%= @ng_pred_host_dep_checks %> +enable_predictive_service_dependency_checks=<%= @ng_pred_svc_dep_checks %> # SOFT STATE DEPENDENCIES