185 lines
10 KiB
Puppet
185 lines
10 KiB
Puppet
## 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 [String] ng_user The name of the Nagios user to be created on the
|
|
# Nagios server. Default is 'nagios'.
|
|
# @param [String] ng_u_comment The comment field for the Nagios user. Default
|
|
# is 'Nagios User'.
|
|
# @param [String] ng_u_groups The group(s) to which the Nagios user should be added. Default is 'nagios'.
|
|
# @param [String] ng_u_shell The login shell for the Nagios user. Default is '/sbin/nologin'.
|
|
# @param [String] ng_u_home The home directory for the Nagios user. Default is '/home/nagios'.
|
|
# @param [Integer] ng_u_uid The user ID for the Nagios user. Default is 1004.
|
|
# @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_event_broker_module The event broker module to be used in
|
|
# the Nagios configuration. Default is an empty string, which means no event
|
|
# broker module will be configured. You can specify a module like 'mod_gearman'
|
|
# to enable the Gearman event broker module, for example.
|
|
# @param [String] ng_glob_host_evt_handler The global host event handler to be
|
|
# used in the Nagios configuration. Default is an empty string, which means no
|
|
# global host event handler will be configured. You can specify a command like
|
|
# 'notify-host-by-email' to set a global host event handler that sends
|
|
# email notifications for host events, for example.
|
|
# @param [String] ng_glob_svc_evt_handler The global service event handler to be
|
|
# used in the Nagios configuration. Default is an empty string, which means no
|
|
# global service event handler will be configured. You can specify a command like
|
|
# 'notify-service-by-email' to set a global service event handler that sends
|
|
# email notifications for service events, for example.
|
|
# @param [String] ng_check_workers The number of check worker processes to be
|
|
# configured in the Nagios configuration. Default is an empty string,
|
|
# which means no specific number of check worker processes will be configured.
|
|
# You can specify a number like '5' to set the number of check worker
|
|
# processes to 5, for example.
|
|
# @param [String] ng_log_file The path to the Nagios log file. Default is
|
|
# '/var/log/nagios/nagios.log'.
|
|
# @param [String] ng_object_cache_file The path to the Nagios object cache file. Default is
|
|
# '/var/spool/nagios/objects.cache'.
|
|
# @param [String] ng_precached_obj_file The path to the Nagios precached object file. Default is
|
|
# '/var/spool/nagios/objects.precache'.
|
|
# @param [String] ng_resource_file The path to the Nagios resource file. Default is
|
|
# '/etc/nagios/private/resource.cfg'.
|
|
# @param [String] ng_status_file The path to the Nagios status file. Default is
|
|
# '/var/log/nagios/status.dat'.
|
|
###############################################################################
|
|
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,
|
|
|
|
# user
|
|
String $ng_user = 'nagios',
|
|
String $ng_u_comment = 'Nagios User',
|
|
String $ng_u_groups = 'nagios',
|
|
String $ng_u_shell = '/sbin/nologin',
|
|
String $ng_u_home = '/home/nagios',
|
|
Integer $ng_u_uid = 1004,
|
|
|
|
# nagios_cfg settings
|
|
String $ng_event_broker_module = '',
|
|
String $ng_glob_host_evt_handler = '',
|
|
String $ng_glob_svc_evt_handler = '',
|
|
String $ng_check_workers = '',
|
|
String $ng_log_file = '/var/log/nagios/nagios.log',
|
|
String $ng_object_cache_file = '/var/spool/nagios/objects.cache',
|
|
String $ng_precached_obj_file = '/var/spool/nagios/objects.precache',
|
|
String $ng_resource_file = '/etc/nagios/private/resource.cfg',
|
|
String $ng_status_file = '/var/log/nagios/status.dat',
|
|
|
|
|
|
# httpd
|
|
Boolean $ng_use_https = false,
|
|
|
|
) {
|
|
# Default facts
|
|
$fqdn = $facts['networking']['fqdn']
|
|
$domain = $facts['networking']['domain']
|
|
$os_name = $facts['os']['name']
|
|
$os_release = $facts['os']['release']['major']
|
|
|
|
# service
|
|
$ng_nagios_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'
|
|
|
|
## old
|
|
$ng_main_config = "${ng_main_dir}/nagios.cfg"
|
|
$ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg"
|
|
$ng_cgi_cfg_erb = 'confdroid_nagios/nagios/cgi_cfg.erb'
|
|
$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_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_resource_erb = 'confdroid_nagios/nagios/resource_cfg.erb'
|
|
$ng_grep_erb = 'confdroid_nagios/selinux/grep.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_add.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_add.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_add.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_add.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_add.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_nagios_service_cmd = 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios'
|
|
|
|
# includes must be last
|
|
include confdroid_nagios::main::config
|
|
}
|