From 011b7a170b14c4fdd498ad35fa661ec0663ba91c Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Sat, 7 Mar 2026 12:28:21 +0100 Subject: [PATCH] OP#436 more controls --- manifests/params.pp | 34 +++++++++++++ templates/nagios/nagios_cfg.erb | 88 +++++---------------------------- 2 files changed, 46 insertions(+), 76 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 2ee2206..8a539d9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -161,6 +161,28 @@ # 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'. +# @param [String] ng_soft_state_dependencies Whether to enable soft state +# dependencies in Nagios. Default is '0'. +# @param [String] ng_time_change_threshold The time change threshold +# for Nagios. Default is '900'. +# @param [String] ng_auto_reschedule_checks Whether to automatically reschedule +# checks in Nagios. Default is '1'. +# @param [String] ng_auto_reschedule_intval The interval for automatically +# rescheduling checks in Nagios. Default is '30'. +# @param [String] ng_auto_reschedule_window The window for automatically +# rescheduling checks in Nagios. Default is '180'. +# @param [String] ng_service_check_timeout The service check timeout +# for Nagios. Default is '60'. +# @param [String] ng_host_check_timeout The host check timeout for Nagios. +# Default is '30'. +# @param [String] ng_event_handler_timeout The event handler timeout +# for Nagios. Default is '30'. +# @param [String] ng_notification_timeout The notification timeout for Nagios. +# Default is '30'. +# @param [String] ng_ocsp_timeout The OCSP timeout for Nagios. Default is '5'. +# @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'. ################################################################################ class confdroid_nagios::params ( @@ -224,6 +246,18 @@ class confdroid_nagios::params ( String $ng_cached_s_check_horizon = '15', String $ng_pred_host_dep_checks = '1', String $ng_pred_svc_dep_checks = '1', + String $ng_soft_state_dependencies = '0', + String $ng_time_change_threshold = '900', + String $ng_auto_reschedule_checks = '1', + String $ng_auto_reschedule_intval = '30', + String $ng_auto_reschedule_window = '180', + String $ng_service_check_timeout = '60', + String $ng_host_check_timeout = '30', + String $ng_event_handler_timeout = '30', + String $ng_notification_timeout = '30', + String $ng_ocsp_timeout = '5', + String $ng_ochp_timeout = '5', + String $ng_perfdata_timeout = '5', # cgi.cfg String $ng_context_help = '1', diff --git a/templates/nagios/nagios_cfg.erb b/templates/nagios/nagios_cfg.erb index 81b7c16..2dfc888 100644 --- a/templates/nagios/nagios_cfg.erb +++ b/templates/nagios/nagios_cfg.erb @@ -90,84 +90,20 @@ cached_service_check_horizon=<%= @ng_cached_s_check_horizon %> enable_predictive_host_dependency_checks=<%= @ng_pred_host_dep_checks %> enable_predictive_service_dependency_checks=<%= @ng_pred_svc_dep_checks %> +soft_state_dependencies=<%= @ng_soft_state_dependencies %> +time_change_threshold=<%= @ng_time_change_threshold %> -# SOFT STATE DEPENDENCIES -# This option determines whether or not Nagios will use soft state -# information when checking host and service dependencies. Normally -# Nagios will only use the latest hard host or service state when -# checking dependencies. If you want it to use the latest state (regardless -# of whether its a soft or hard state type), enable this option. -# Values: -# 0 = Don't use soft state dependencies (default) -# 1 = Use soft state dependencies - -soft_state_dependencies=0 - - - -# TIME CHANGE ADJUSTMENT THRESHOLDS -# These options determine when Nagios will react to detected changes -# in system time (either forward or backwards). - -#time_change_threshold=900 - - - -# AUTO-RESCHEDULING OPTION -# This option determines whether or not Nagios will attempt to -# automatically reschedule active host and service checks to -# "smooth" them out over time. This can help balance the load on -# the monitoring server. -# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE -# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY - -auto_reschedule_checks=0 - - - -# AUTO-RESCHEDULING INTERVAL -# This option determines how often (in seconds) Nagios will -# attempt to automatically reschedule checks. This option only -# has an effect if the auto_reschedule_checks option is enabled. -# Default is 30 seconds. -# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE -# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY - -auto_rescheduling_interval=30 - - - -# AUTO-RESCHEDULING WINDOW -# This option determines the "window" of time (in seconds) that -# Nagios will look at when automatically rescheduling checks. -# Only host and service checks that occur in the next X seconds -# (determined by this variable) will be rescheduled. This option -# only has an effect if the auto_reschedule_checks option is -# enabled. Default is 180 seconds (3 minutes). -# WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE -# PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY - -auto_rescheduling_window=180 - - - -# TIMEOUT VALUES -# These options control how much time Nagios will allow various -# types of commands to execute before killing them off. Options -# are available for controlling maximum time allotted for -# service checks, host checks, event handlers, notifications, the -# ocsp command, and performance data commands. All values are in -# seconds. - -service_check_timeout=60 -host_check_timeout=30 -event_handler_timeout=30 -notification_timeout=30 -ocsp_timeout=5 -ochp_timeout=5 -perfdata_timeout=5 - +auto_reschedule_checks=<%= @ng_auto_reschedule_checks %> +auto_rescheduling_interval=<%= @ng_auto_reschedule_intval %> +auto_rescheduling_window=<%= @ng_auto_reschedule_window %> +service_check_timeout=<%= @ng_service_check_timeout %> +host_check_timeout=<%= @ng_host_check_timeout %> +event_handler_timeout=<%= @ng_event_handler_timeout %> +notification_timeout=<%= @ng_notification_timeout %> +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