## confdroid_nagios::params # Module name: confdroid_nagios # Author: 12ww1160 (12ww1160@confdroid.com) # @summary Class holds all parameters for the confdroid_nagios module and is # inherited by all classes except defines. # @param [String] ng_nagios_server The hostname or IP address of the # Nagios server. This will determine the installation selection and the # of the clients to connect to the Nagios server. # @param [Array] ng_reqpackages_server An array of packages to be installed on # the Nagios server. # @param [Array] ng_reqpackages_client An array of packages to be installed on # the Nagios clients. # @param [String] ng_pkg_ensure The ensure value for all packages. Default is # 'present'. # @param [Boolean] ng_include_nrpe Whether to include the NRPE client on the # Nagios clients. Default is true. # @param [Boolean] ng_use_https Whether to configure the Nagios web interface # to use HTTPS. Default is false. We recommend using a reverse proxy # with SSL termination in front of the Nagios web interface, so this is # disabled by default. # @param [String] ng_main_user The username for the Nagios web interface. # Default is $ng_users. # @param [String] ng_main_password The encrypted password for the Nagios web # interface. Default is $ng_users. Must be properly encrypted using the # htpasswd utility. # @param [String] ng_context_help Whether to enable the context help in the # Nagios web interface. Default is '1'. # @param [String] ng_log_file The path to the Nagios log file. Default is # '/var/log/nagios/nagios.log'. # @param [String] ng_ping_warn The warning threshold for the check_ping # command. Default is '100.0,20%'. # @param [String] ng_ping_crit The critical threshold for the check_ping # command. Default is '500.0,60%'. # @param [String] ng_ping_ensure The ensure value for the check_ping command. # Default is 'present'. # @param [String] ng_disk_warn The warning threshold for the check_disk # command. Default is '20%'. # @param [String] ng_disk_crit The critical threshold for the check_disk # command. Default is '10%'. # @param [String] ng_disk_ensure The ensure value for the check_disk command. # Default is 'present'. # @param [String] ng_swap_warn The warning threshold for the check_swap # command. Default is '20'. # @param [String] ng_swap_crit The critical threshold for the check_swap # command. Default is '10'. # @param [String] ng_swap_ensure The ensure value for the check_swap command. # Default is 'present'. # @param [String] ng_users_warn The warning threshold for the check_users # command. Default is '20'. # @param [String] ng_users_crit The critical threshold for the check_users # command. Default is '50'. # @param [String] ng_users_ensure The ensure value for the check_users command. # Default is 'present'. # @param [String] ng_procs_tot_warn The warning threshold for the check_procs # command with total processes. Default is '330'. # @param [String] ng_procs_tot_crit The critical threshold for the check_procs # command with total processes. Default is '400'. # @param [String] ng_procs_tot_param The parameters for the check_procs command # with total processes. Default is 'RDST'. # @param [String] ng_procs_tot_ens The ensure value for the check_procs # command with total processes. Default is 'present'. # @param [String] ng_procs_z_warn The warning threshold for the check_procs # command with zombie processes. Default is '10'. # @param [String] ng_procs_z_crit The critical threshold for the check_procs # command with zombie processes. Default is '30'. # @param [String] ng_procs_z_param The parameters for the check_procs command # with zombie processes. Default is 'Z'. # @param [String] ng_procs_z_ensure The ensure value for the check_procs command # with zombie processes. Default is 'present'. # @param [String] ng_load_warn The warning threshold for the check_load command. # Default is '5.00,4.00,3.00'. # @param [String] ng_load_crit The critical threshold for the check_load command. # Default is '10.00,6.00,4.00'. # @param [String] ng_load_ensure The ensure value for the check_load command. # Default is 'present'. # @param [String] ng_contactgroup_name The name of the default contact group. # Default is 'admins'. # @param [String] ng_contactgroup_alias The alias of the default contact group. # Default is 'Nagios Administrators'. # @param [String] ng_contact_name The name of the default contact. Default is # 'nagiosadmin'. # @param [String] ng_contact_alias The alias of the default contact. Default is # 'Nagios Admin'. # @param [String] ng_contact_groups The contact groups for the default contact. # Default is 'admins'. # @param [String] ng_contact_email The email address for the default contact. # Default is 'nagiosadmin@example.net'. # @param [String] ng_hostgroup_name The name of the default host group. Default # is 'linux-servers'. # @param [String] ng_hostgroup_alias The alias of the default host group. Default # is 'Linux Servers'. # @param [String] ng_max_check_attempts The maximum number of check attempts # before a host or service is considered down. Default is '10'. # @param [Boolean] ng_enable_swap_check Whether to enable the check_swap # command. Default is true. # @param [String] ng_status_upd_interval The interval in seconds for Nagios # to update the status file. Default is '10'. # @param [String] ng_check_ext_commands Whether to allow external commands # to be submitted to Nagios. Default is '1'. # @param [String] ng_user The user to run the Nagios service as. # Default is 'nagios'. # @param [Boolean] ng_enable_target Whether to enable the generation of host and # service configuration files for the Nagios server. Default is true. # @param [String] ng_contactgroup_members The members of the default contact # group. Default is 'nagiosadmin'. # @param [Boolean] ng_purge_target Whether to purge unmanaged host and services # configuration files. Default is true. # @param [String] ng_event_broker_options The event broker options for Nagios. # Default is '-1'. # @param [Boolean] ng_enable_query_handler Whether to enable the Nagios query # handler. Default is false. # @param [Array] ng_event_broker_module The event broker modules for Nagios. # Default is []. # @param [String] ng_log_rotation_method The log rotation method for Nagios. # Default is 'd'. # @param [String] ng_use_syslog Whether to use syslog for logging in Nagios. # Default is '1'. # @param [String] ng_log_notifications Whether to log notifications in Nagios. # Default is '1'. # @param [String] ng_log_service_retries Whether to log service check retries # in Nagios. Default is '1'. # @param [String] ng_log_host_retries Whether to log host check retries # in Nagios. Default is '1'. # @param [String] ng_log_event_handlers Whether to log event handlers in Nagios. # Default is '1'. # @param [String] ng_log_initial_states Whether to log initial states in Nagios. # Default is '0'. # @param [String] ng_log_current_states Whether to log current states in Nagios. # Default is '1'. # @param [String] ng_log_external_commands Whether to log external commands in # Nagios. Default is '1'. # @param [String] ng_log_passive_checks Whether to log passive checks in Nagios. # Default is '1'. # @param [Array] ng_glob_host_evt_handler An array of global host event handlers # for Nagios. Default is []. # @param [Array] ng_glob_svc_evt_handler An array of global service event handlers # for Nagios. Default is []. # @param [String] ng_svc_int_check_delay The service inter-check delay method # for Nagios. Default is 's'. # @param [String] ng_max_svc_check_spread The maximum service check spread for # Nagios. Default is '30'. # @param [String] ng_svc_interleave_factor The service interleave factor for # Nagios. Default is 's'. # @param [String] ng_host_int_check_delay The host inter-check delay method # for Nagios. Default is 's'. # @param [String] ng_max_host_check_spread The maximum host check spread for # Nagios. Default is '30'. # @param [String] ng_max_concurrent_checks The maximum number of concurrent checks # for Nagios. Default is '0'. # @param [String] ng_check_res_reaper_freq The check result reaper frequency for # 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'. # @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'. # @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 ( # main String $ng_nagios_server = 'nagios.example.net', Array $ng_reqpackages_server = ['nagios','nagios-devel'], Array $ng_reqpackages_client = ['net-snmp-utils','nagios-plugins','nagios-plugins-all','nagios-plugins-nrpe','nagios-common'], String $ng_pkg_ensure = 'present', Boolean $ng_include_nrpe = true, String $ng_main_user = 'nagios', String $ng_main_password = 'nagios', String $ng_max_check_attempts = '10', String $ng_status_upd_interval = '10', String $ng_check_ext_commands = '1', String $ng_user = 'nagios', Boolean $ng_enable_target = true, Boolean $ng_purge_target = true, # contact groups String $ng_contactgroup_name = 'admins', String $ng_contactgroup_alias = 'Nagios Administrators', String $ng_contactgroup_members = 'nagiosadmin', # contacts String $ng_contact_name = 'nagiosadmin', String $ng_contact_alias = 'Nagios Admin', String $ng_contact_groups = 'admins', String $ng_contact_email = 'nagiosadmin@example.net', # hostgroups String $ng_hostgroup_name = 'linux-servers', String $ng_hostgroup_alias = 'Linux Servers', # nagios.cfg String $ng_log_file = '/var/log/nagios/nagios.log', String $ng_event_broker_options = '-1', Boolean $ng_enable_query_handler = false, Array $ng_event_broker_module = [], String $ng_log_rotation_method = 'd', String $ng_use_syslog = '1', String $ng_log_notifications = '1', String $ng_log_service_retries = '1', String $ng_log_host_retries = '1', String $ng_log_event_handlers = '1', String $ng_log_initial_states = '0', String $ng_log_current_states = '1', String $ng_log_external_commands = '1', String $ng_log_passive_checks = '1', Array $ng_glob_host_evt_handler = [], Array $ng_glob_svc_evt_handler = [], String $ng_svc_int_check_delay = 's', String $ng_max_svc_check_spread = '30', String $ng_svc_interleave_factor = 's', String $ng_host_int_check_delay = 's', String $ng_max_host_check_spread = '30', 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', 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', 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', # httpd Boolean $ng_use_https = false, # check command parameters ## ping String $ng_ping_warn = '100.0,20%', String $ng_ping_crit = '500.0,60%', String $ng_ping_ensure = 'present', ## disk String $ng_disk_warn = '20%', String $ng_disk_crit = '10%' , String $ng_disk_ensure = 'present', # swap String $ng_swap_warn = '20', String $ng_swap_crit = '10', String $ng_swap_ensure = 'present', # users String $ng_users_warn = '20', String $ng_users_crit = '50', String $ng_users_ensure = 'present', #total procs String $ng_procs_tot_warn = '330', String $ng_procs_tot_crit = '400', String $ng_procs_tot_param = 'RDST', String $ng_procs_tot_ens = 'present', # zombie procs String $ng_procs_z_warn = '10', String $ng_procs_z_crit = '30', String $ng_procs_z_param = 'Z', String $ng_procs_z_ensure = 'present', # load String $ng_load_warn = '5.00,4.00,3.00', String $ng_load_crit = '10.00,6.00,4.00', String $ng_load_ensure = 'present', # single nagios checks Boolean $ng_enable_swap_check = true, ) { # Default facts $fqdn = $facts['networking']['fqdn'] $hostname = $facts['networking']['hostname'] $domain = $facts['networking']['domain'] $os_name = $facts['os']['name'] $os_release = $facts['os']['release']['major'] # service $ng_service = 'nagios' # directories $ng_main_dir = '/etc/nagios' $ng_conf_d_dir = "${ng_main_dir}/conf.d" $ng_objects_dir = "${ng_main_dir}/objects" $ng_private_dir = "${ng_main_dir}/private" $ng_usr_incl = '/usr/include/nagios' $ng_lib_dir = '/usr/lib64/nagios' $ng_log_dir = '/var/log/nagios' $ng_log_archives = "${ng_log_dir}/archives" $ng_spool_dir = '/var/spool/nagios' $ng_usr_share = '/usr/share/nagios' $ng_share_html = "${ng_usr_share}/html" $ng_run_dir = '/var/run/nagios' $ng_cmd_dir = "${ng_spool_dir}/cmd" $ng_checkresults_dir = "${ng_spool_dir}/checkresults" # files $ng_nagios_cfg_file = "${ng_main_dir}/nagios.cfg" $ng_nagios_cfg_erb = 'confdroid_nagios/nagios/nagios_cfg.erb' $ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg" $ng_cgi_cfg_erb = 'confdroid_nagios/nagios/cgi_cfg.erb' # nagios $ng_target_templates = "${ng_conf_d_dir}/nagios_templates.cfg" $ng_templates_head_erb = 'confdroid_nagios/nagios/templates_cfg_head.erb' $ng_templates_rule_erb = 'confdroid_nagios/nagios/templates_cfg_rule.erb' $ng_tgt_timeperiods_base = "${ng_conf_d_dir}/nagios_timeperiods.cfg" $ng_tgt_timep_add = "${ng_conf_d_dir}/nagios_timeperiods.cfg" $ng_tgt_timep_head_erb = 'confdroid_nagios/nagios/timeperiods_cfg_head.erb' $ng_tgt_timep_rule_erb = 'confdroid_nagios/nagios/timeperiods_cfg_rule.erb' $ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg" $ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg" $ng_target_hostgroup_base = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg" $ng_tgt_hostgroup_add = "${ng_conf_d_dir}/nagios_hostgroups.cfg" $ng_tgt_hostgrp_head_erb = 'confdroid_nagios/nagios/hostgroups_cfg_head.erb' $ng_tgt_hostgrp_rule_erb = 'confdroid_nagios/nagios/hostgroups_cfg_rule.erb' $ng_target_hostdep = "${ng_conf_d_dir}/nagios_hostdependency.cfg" $ng_target_hostesc = "${ng_conf_d_dir}/nagios_hostescalation.cfg" $ng_target_hostext = "${ng_conf_d_dir}/nagios_hostextinfo.cfg" $ng_target_service = "${ng_conf_d_dir}/nagios_service.cfg" $ng_target_svcgrp_base = "${ng_conf_d_dir}/nagios_servicegroups_base.cfg" $ng_tgt_servicegroup_add = "${ng_conf_d_dir}/nagios_servicegroups.cfg" $ng_tgt_svcgrp_head_erb = 'confdroid_nagios/nagios/svcgroups_cfg_head.erb' $ng_tgt_svcgrp_rule_erb = 'confdroid_nagios/nagios/svcgroups_cfg_rule.erb' $ng_target_base_contact = "${ng_conf_d_dir}/nagios_contact_base.cfg" $ng_target_add_contact = "${ng_conf_d_dir}/nagios_contact.cfg" $ng_contacts_head_erb = 'confdroid_nagios/nagios/contacts_cfg_head.erb' $ng_contacts_rule_erb = 'confdroid_nagios/nagios/contacts_cfg_rule.erb' $ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg" $ng_tgt_contactgroup_add = "${ng_conf_d_dir}/nagios_contactgroup.cfg" $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_service_cmd = 'check_nagios!/var/spool/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' $ng_resource_file = "${ng_private_dir}/resource.cfg" $ng_resource_erb = 'confdroid_nagios/nagios/resource_cfg.erb' $ng_object_cache_file = "${ng_spool_dir}/objects.cache" $ng_precached_obj_file = "${ng_spool_dir}/objects.precache" $ng_status_file = "${ng_spool_dir}/status.dat" $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" $ng_state_retention_file = "${ng_spool_dir}/retention.dat" ## old $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb' $ng_statcgi_erb = 'confdroid_nagios/selinux/statuscgi.erb' $ng_statdat_erb = 'confdroid_nagios/selinux/statusdat.erb' $ng_checknrpe_erb = 'confdroid_nagios/selinux/checknrpe.erb' $ng_checknagios_erb = 'confdroid_nagios/selinux/checknagios.erb' $ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf' $ng_nagios_conf_erb = 'confdroid_nagios/httpd/nagios_conf.erb' $ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf' $ng_welcome_conf_erb = 'confdroid_nagios/httpd/welcome_conf.erb' $ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf' $ng_forward_conf_erb = 'confdroid_nagios/httpd/forward_conf.erb' $ng_get_cert_erb = 'confdroid_nagios/certbot/get_cert.erb' $ng_unless_get_cert = 'confdroid_nagios/certbot/unless_get_cert.erb' $ng_unless_renew_erb = 'confdroid_nagios/certbot/unless_renew_cert.erb' $ng_index_html_file = '/var/www/html/index.html' $ng_index_html_erb = 'confdroid_nagios/httpd/index_html.erb' $ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf' $ng_ssl_vhost_erb = 'confdroid_nagios/httpd/nagios_ssl_vhost.erb' $ng_grep_erb = 'confdroid_nagios/selinux/grep.erb' # includes must be last include confdroid_nagios::main::config }