adding more parameters

This commit is contained in:
Arne Teuke
2017-07-24 16:00:07 +01:00
parent 62c755dcd3
commit 9602eb550c
6 changed files with 1268 additions and 229 deletions

View File

@@ -212,123 +212,314 @@
# listen to, i.e. 'nagios.example.net'. Unlike `ng_nagios_server`, this
# should not be the FQDN of the nagios host, but a web server domain name.
# required for certbot and used in the web templates.
# @param [string] ng_log_file main log file where service- and host events
# are logged.
# @param [string] ng_max_check_attempts maximum amount of checks done by nagios
# @param [string] ng_object_cache_file determines where object definitions are
# cached when # Nagios starts/restarts.
# @param [string] ng_precached_obj_file determines the location of the
# precached object file.
# @param [string] optional resource file that contains $USERx$ macro definitions.
# @param [string] ng_status_file. where the current status of all monitored
# services and hosts is stored.
# @param [string] ng_status_upd_interval status file update interval.
# determines the frequency (in seconds) that # Nagios will periodically dump
# program, host, and # service status data.
# @param [string] ng_check_ext_commands allows you to specify whether or not
# Nagios should check # for external commands in the command file specified
# by `ng_command_file`.
# @param [string] ng_command_file file that Nagios checks for external command
# requests. It is also where the command CGI will write commands that are
# submitted # by users, so it must be writeable by the user that the web server
# is running as.
# @param [boolean] ng_enable_query_handler Whether to enable the query handler
# for running nagios in cluster mode.
# @param [string] ng_query_socket the socket for the query handler
# @param [string] ng_lock_file lockfile that Nagios will use to store its PID
# number in when it is running in daemon mode.
# @param [string] ng_temp_file temporary file that is used as scratch space
# when Nagios # updates the status log, cleans the comment file, etc.
# @param [string] ng_temp_path path where Nagios can create temp files for
# service and # host check results, etc.
# @param [string] event_broker_options Controls what (if any) data gets sent
# to the event broker.
# @param [string] ng_event_broker_module specify an event broker
# (including full path) module that should # by loaded by Nagios at startup.
# Specify multiple modules as array ['path/to/module1','/path/to/module2']
# @param [string] ng_log_rotation_method. Valid options:
# n = None - don't rotate the log
# h = Hourly rotation (top of the hour)
# d = Daily rotation (midnight every day)
# w = Weekly rotation (midnight on Saturday evening)
# m = Monthly rotation (midnight last day of month)
# @param [string] ng_log_archive_path directory where archived (rotated)
# log files should be # placed (assuming you've chosen to do log rotation).
# @param [string] ng_use_syslog whether to log messages to the syslog
# facility, as well as the Nagios log file. Valid options are `0` and `1`.
# @param [string] ng_log_notifications Whether to log notifications in addition
# to regular messages. Valid options are `0` and `1`.
# @param [string] ng_log_service_retries Whether to log service retries.
# Valid options are `0` and `1`.
# @param [string] ng_log_host_retries Whether to log host retries.
# Valid options are `0` and `1`.
# @param [string] ng_log_event_handlers. Whether to log host and service event
# handlers. Valid options are `0` and `1`.
# @param [string] ng_log_initial_states Whether to log initial states.
# Valid options are `0` and `1`.
# @param [string] ng_log_current_states Whether to log all current host and
# service states to the main log file after log has been rotated.
# Valid options are `0` and `1`.
# @param [string] ng_log_external_commands Whether to log external commands.
# Valid options are `0` and `1`.
# @param [string] ng_log_passive_checks Whether to log passive checks.
# Valid options are `0` and `1`.
# @param [string] ng_glob_host_evt_handler Specify a global host event
# handler # command that is to be run for every host or service state change.
# The global event handler is executed immediately prior to the event
# handler that you have optionally specified in each host or # service
# definition. The command argument is the short name of a # command definition
# that you define in your host configuration file.
# @param [string] ng_glob_svc_evt_handler Specify a global service event
# handler # command that is to be run for every host or service state change.
# The global event handler is executed immediately prior to the event
# handler that you have optionally specified in each host or # service
# definition. The command argument is the short name of a # command definition
# that you define in your host configuration file.
# @param [string] ng_svc_int_check_delay method that Nagios should use when
# initially "spreading out" service checks when it starts monitoring.
# Valid options:
# n = None - don't use any delay between checks
# d = Use a "dumb" delay of 1 second between checks
# s = Use "smart" inter-check delay calculation
# x.xx = Use an inter-check delay of x.xx seconds
# @param [string] ng_max_service_check_spread timeframe (in minutes) from the
# program start time that an initial check of all services should be completed
# @param [string] ng_svc_interleave_factor determines how service checks are
# interleaved. Valid options: s = Use "smart" interleave factor calculation
# x = Use an interleave factor of x, where x is greater than or equal to 1.
# @param [string] ng_host_int_check_delay method that Nagios should use when
# initially "spreading out" host checks when it starts monitoring.
# Valid options:
# n = None - don't use any delay between checks
# d = Use a "dumb" delay of 1 second between checks
# s = Use "smart" inter-check delay calculation
# x.xx = Use an inter-check delay of x.xx seconds
# @param [string] ng_max_host_check_spread timeframe (in minutes) from the
# program start time that an initial check of all hosts should # be completed.
# @param [string] ng_max_concurrent_checks specify the maximum number of
# service checks that can be run in parallel at any given time. A value of 0
# will not restrict the number of concurrent checks that are being executed.
# @param [string] ng_check_res_reaper_freq frequency (in seconds!) in which
# Nagios will process the results of host and service checks.
# @param [string] ng_check_result_path directory where Nagios stores the
# results of host and service checks that have not yet been processed.
# @param [string] ng_max_check_res_file_age maximum age (in seconds) which
# check result files are considered to be valid.
# @param [string] ng_cached_h_check_horizon 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.
# @param [string] ng_cached_s_check_horizon 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 the service check logic. Too high of a value for
# this option may result in inaccurate service states being used by Nagios,
# while a lower value may result in a performance hit for service checks.
# Use a value of 0 to disable service check caching.
# @param [string] ng_pred_host_dep_checks Whether Nagios will attempt to execute
# checks of hosts when it predicts that future dependency logic test may be
# needed. Valid options are `0` and `1`.
# @param [string] ng_pred_svc_dep_checks Whether Nagios will attempt to execute
# checks of services when it predicts that future dependency logic test may be
# needed. Valid options are `0` and `1`.
# @param [string] ng_soft_state_dependencies Whether or not Nagios will use
# soft state information when checking host and service dependencies.
# Valid options are `0` and `1`.
# @param [string] ng_time_change_threshold when Nagios will react to detected
# changes in system time (either forward or backwards).
# @param [string] ng_auto_reschedule_checks Whether Nagios will attempt to
# automatically reschedule active host and service checks to
# "smooth" them out over time. Experimental feature.
# Valid options are `0` and `1`.
# @param [string] ng_auto_reschedule_intval how often (in seconds) Nagios will
# attempt to automatically reschedule checks. only has an effect if
# `ng_auto_reschedule_checks` is set to `1`.
# @param [string] ng_auto_reschedule_window 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.
###############################################################################
class cd_nagios::params (
$pkg_ensure = 'latest',
$pkg_ensure = 'latest',
$ng_nagios_server = "nagios.${::domain}",
$ng_nagios_ext_ip = undef,
$ng_mail_user = "admin@${::domain}",
$ng_nagios_server = "nagios.${::domain}",
$ng_nagios_ext_ip = undef,
$ng_mail_user = "admin@${::domain}",
$ng_include_nrpe = true,
$ng_include_nrpe = true,
# firewall
$ng_include_fw = true,
$ng_use_https = true,
$ng_http_https_fw = true,
$ng_fw_order = '50',
$ng_http_port = '80',
$ng_https_port = '443',
$ng_include_fw = true,
$ng_use_https = true,
$ng_http_https_fw = true,
$ng_fw_order = '50',
$ng_http_port = '80',
$ng_https_port = '443',
# check command parameters
## ping
$ng_ping_warn = '100.0,20%',
$ng_ping_crit = '500.0,60%',
$ng_ping_ensure = 'present',
$ng_ping_warn = '100.0,20%',
$ng_ping_crit = '500.0,60%',
$ng_ping_ensure = 'present',
## disk
$ng_disk_warn = '20%',
$ng_disk_crit = '10%' ,
$ng_disk_ensure = 'present',
$ng_disk_warn = '20%',
$ng_disk_crit = '10%' ,
$ng_disk_ensure = 'present',
# swap
$ng_swap_warn = '20',
$ng_swap_crit = '10',
$ng_swap_ensure = 'present',
$ng_swap_warn = '20',
$ng_swap_crit = '10',
$ng_swap_ensure = 'present',
# users
$ng_users_warn = '20',
$ng_users_crit = '50',
$ng_users_ensure = 'present',
$ng_users_warn = '20',
$ng_users_crit = '50',
$ng_users_ensure = 'present',
#total procs
$ng_procs_tot_warn = '330',
$ng_procs_tot_crit = '400',
$ng_procs_tot_param = 'RDST',
$ng_procs_tot_ens = 'present',
$ng_procs_tot_warn = '330',
$ng_procs_tot_crit = '400',
$ng_procs_tot_param = 'RDST',
$ng_procs_tot_ens = 'present',
# zombie procs
$ng_procs_z_warn = '10',
$ng_procs_z_crit = '30',
$ng_procs_z_param = 'Z',
$ng_procs_z_ensure = 'present',
$ng_procs_z_warn = '10',
$ng_procs_z_crit = '30',
$ng_procs_z_param = 'Z',
$ng_procs_z_ensure = 'present',
# load
$ng_load_warn = '5.00,4.00,3.00',
$ng_load_crit = '10.00,6.00,4.00',
$ng_load_ensure = 'present',
$ng_load_warn = '5.00,4.00,3.00',
$ng_load_crit = '10.00,6.00,4.00',
$ng_load_ensure = 'present',
# user settings
$ng_user = 'nagios',
$ng_u_comment = 'Nagios service user',
$ng_u_uid = '1004',
$ng_user_home = '/var/spool/nagios',
$ng_u_groups = undef,
$ng_user_shell = '/bin/bash',
$ng_user = 'nagios',
$ng_u_comment = 'Nagios service user',
$ng_u_uid = '1004',
$ng_user_home = '/var/spool/nagios',
$ng_u_groups = undef,
$ng_user_shell = '/bin/bash',
# cgi settings
$ng_context_help = '1',
$ng_pending_state = '1',
$ng_use_auth = '1',
$ng_use_ssl_auth = '0',
$ng_enable_def_user = false,
$ng_def_user_name = 'nagios_insecure',
$ng_nagios_admin = 'nagios_sec_adm',
$ng_sysinfo_auth = '',
$ng_confinfo_auth = '',
$ng_command_auth = '',
$ng_hostview_auth = '',
$ng_serviceview_auth = '',
$ng_host_cmd_auth = '',
$ng_svc_cmd_auth = '',
$ng_readonly_auth = '' ,
$ng_statusmap_img = 'smbackground.gd2',
$ng_use_colormap = false,
$ng_colormap_red = '255',
$ng_colormap_green = '255',
$ng_colormap_blue = '255',
$ng_statusmap_layout = '6',
$ng_wrl_layout = '4',
$ng_incl_own_wrl = false,
$ng_statuswrl_include = '',
$ng_ping_syntax = '/bin/ping -n -U -c 5 $HOSTADDRESS$',
$ng_refresh_rate = '90',
$ng_result_limit = '100',
$ng_escape_html = '1',
$ng_use_sound = false,
$ng_host_unreachable = 'hostdown.wav',
$ng_host_down = 'hostdown.wav',
$ng_svc_critical = 'critical.wav',
$ng_svc_warn = 'warning.wav',
$ng_svc_unknown = 'warning.wav',
$ng_normal_sound = 'noproblem.wav',
$ng_action_url_target = '_blank',
$ng_notes_url_target = '_blank',
$ng_lock_author_names = '1',
$ng_enable_splunk = false,
$ng_splunk_url = 'http://127.0.0.1:8000/',
$ng_navbar_addresses = '1',
$ng_navbar_aliases = '1',
$ng_ack_no_sticky = '0',
$ng_ack_no_send = '0',
$ng_context_help = '1',
$ng_pending_state = '1',
$ng_use_auth = '1',
$ng_use_ssl_auth = '0',
$ng_enable_def_user = false,
$ng_def_user_name = 'nagios_insecure',
$ng_nagios_admin = 'nagios_sec_adm',
$ng_sysinfo_auth = '',
$ng_confinfo_auth = '',
$ng_command_auth = '',
$ng_hostview_auth = '',
$ng_serviceview_auth = '',
$ng_host_cmd_auth = '',
$ng_svc_cmd_auth = '',
$ng_readonly_auth = '' ,
$ng_statusmap_img = 'smbackground.gd2',
$ng_use_colormap = false,
$ng_colormap_red = '255',
$ng_colormap_green = '255',
$ng_colormap_blue = '255',
$ng_statusmap_layout = '6',
$ng_wrl_layout = '4',
$ng_incl_own_wrl = false,
$ng_statuswrl_include = '',
$ng_ping_syntax = '/bin/ping -n -U -c 5 $HOSTADDRESS$',
$ng_refresh_rate = '90',
$ng_result_limit = '100',
$ng_escape_html = '1',
$ng_use_sound = false,
$ng_host_unreachable = 'hostdown.wav',
$ng_host_down = 'hostdown.wav',
$ng_svc_critical = 'critical.wav',
$ng_svc_warn = 'warning.wav',
$ng_svc_unknown = 'warning.wav',
$ng_normal_sound = 'noproblem.wav',
$ng_action_url_target = '_blank',
$ng_notes_url_target = '_blank',
$ng_lock_author_names = '1',
$ng_enable_splunk = false,
$ng_splunk_url = 'http://127.0.0.1:8000/',
$ng_navbar_addresses = '1',
$ng_navbar_aliases = '1',
$ng_ack_no_sticky = '0',
$ng_ack_no_send = '0',
# selinux
$ng_use_selinux_tools = true,
$ng_use_selinux_tools = true,
# httpd
$ng_required_hosts = '',
$ng_required_ips = '127.0.0.0/8',
$ng_enable_index = true,
$ng_required_hosts = '',
$ng_required_ips = '127.0.0.0/8',
$ng_enable_index = true,
# certbot
$ng_enable_certbot = true,
$ng_certbot_webroot = '/var/www/html',
$ng_webserver_name = "nagios.${::domain}",
$ng_enable_certbot = true,
$ng_certbot_webroot = '/var/www/html',
$ng_webserver_name = "nagios.${::domain}",
# main settings
$ng_log_file = '/var/log/nagios/nagios.log',
$ng_max_check_attempts = '10',
$ng_object_cache_file = '/var/spool/nagios/objects.cache',
$ng_precached_obj_file = '/var/spool/nagios/objects.precache',
$ng_resource_file = '/etc/nagios/private/resource.cfg',
$ng_status_file = '/var/log/nagios/status.dat',
$ng_status_upd_interval = '10',
$ng_check_ext_commands = '1',
$ng_command_file = '/var/spool/nagios/cmd/nagios.cmd',
$ng_enable_query_handler = false,
$ng_query_socket = '/var/spool/nagios/cmd/nagios.qh',
$ng_lock_file = '/var/run/nagios/nagios.pid',
$ng_temp_file = '/var/spool/nagios/nagios.tmp',
$ng_temp_path = '/tmp',
$ng_event_broker_options = '-1',
$ng_event_broker_module = '',
$ng_log_rotation_method = 'h',
$ng_log_archive_path = '/var/log/nagios/archives',
$ng_use_syslog = '1',
$ng_log_notifications = '1',
$ng_log_service_retries = '1',
$ng_log_host_retries = '1',
$ng_log_event_handlers = '1',
$ng_log_initial_states = '0',
$ng_log_current_states = '1',
$ng_log_external_commands = '1',
$ng_log_passive_checks = '1',
$ng_glob_host_evt_handler = '',
$ng_glob_svc_evt_handler = '',
$ng_svc_int_check_delay = 's',
$ng_max_svc_check_spread = '30',
$ng_svc_interleave_factor = 's',
$ng_host_int_check_delay = 's',
$ng_max_host_check_spread = '30',
$ng_max_concurrent_checks = '0',
$ng_check_res_reaper_freq = '10',
$ng_max_check_res_reap_time = '30',
$ng_check_result_path = '/var/spool/nagios/checkresults',
$ng_max_check_res_file_age = '3600',
$ng_cached_h_check_horizon = '15',
$ng_cached_s_check_horizon = '15',
$ng_pred_host_dep_checks = '1',
$ng_pred_svc_dep_checks = '1',
$ng_soft_state_dependencies = '0',
$ng_time_change_threshold = '900',
$ng_auto_reschedule_checks = '0',
$ng_auto_reschedule_intval = '30',
$ng_auto_reschedule_window = '180',
) {
@@ -345,50 +536,68 @@ $ng_webserver_name = "nagios.${::domain}",
}
# service
$ng_service = 'nagios'
$ae_service = 'httpd'
$ng_service = 'nagios'
$ae_service = 'httpd'
# 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_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"
# files
$ng_main_config = "${ng_main_dir}/nagios.cfg"
$ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg"
$ng_cgi_cfg_erb = 'cd_nagios/nagios/cgi_cfg.erb'
$ng_htpasswd_file = "${ng_main_dir}/passwd"
$ng_htpasswd_head = 'cd_nagios/nagios/htpasswd_head.erb'
$ng_htpasswd_rule = 'cd_nagios/nagios/htpasswd_rule.erb'
$ng_taccgi_erb = 'cd_nagios/selinux/taccgi.erb'
$ng_statcgi_erb = 'cd_nagios/selinux/statuscgi.erb'
$ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf'
$ng_nagios_conf_erb = 'cd_nagios/httpd/nagios_conf.erb'
$ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf'
$ng_welcome_conf_erb = 'cd_nagios/httpd/welcome_conf.erb'
$ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf'
$ng_forward_conf_erb = 'cd_nagios/httpd/forward_conf.erb'
$ng_get_cert_erb = 'cd_nagios/certbot/get_cert.erb'
$ng_unless_get_cert = 'cd_nagios/certbot/unless_get_cert.erb'
$ng_unless_renew_erb = 'cd_nagios/certbot/unless_renew_cert.erb'
$ng_index_html_file = '/var/www/html/index.html'
$ng_index_html_erb = 'cd_nagios/httpd/index_html.erb'
$ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf'
$ng_ssl_vhost_erb = 'cd_nagios/httpd/nagios_ssl_vhost.erb'
$ng_main_config = "${ng_main_dir}/nagios.cfg"
$ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg"
$ng_cgi_cfg_erb = 'cd_nagios/nagios/cgi_cfg.erb'
$ng_htpasswd_file = "${ng_main_dir}/passwd"
$ng_htpasswd_head = 'cd_nagios/nagios/htpasswd_head.erb'
$ng_htpasswd_rule = 'cd_nagios/nagios/htpasswd_rule.erb'
$ng_taccgi_erb = 'cd_nagios/selinux/taccgi.erb'
$ng_statcgi_erb = 'cd_nagios/selinux/statuscgi.erb'
$ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf'
$ng_nagios_conf_erb = 'cd_nagios/httpd/nagios_conf.erb'
$ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf'
$ng_welcome_conf_erb = 'cd_nagios/httpd/welcome_conf.erb'
$ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf'
$ng_forward_conf_erb = 'cd_nagios/httpd/forward_conf.erb'
$ng_get_cert_erb = 'cd_nagios/certbot/get_cert.erb'
$ng_unless_get_cert = 'cd_nagios/certbot/unless_get_cert.erb'
$ng_unless_renew_erb = 'cd_nagios/certbot/unless_renew_cert.erb'
$ng_index_html_file = '/var/www/html/index.html'
$ng_index_html_erb = 'cd_nagios/httpd/index_html.erb'
$ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf'
$ng_ssl_vhost_erb = 'cd_nagios/httpd/nagios_ssl_vhost.erb'
$ng_nagios_cfg_file = "${ng_main_dir}/nagios.cfg"
$ng_nagios_cfg_erb = 'cd_nagios/nagios/nagios_cfg.erb'
# certbot
$ng_certbot_main_dir = '/etc/letsencrypt'
$ng_certbot_archive = "${ng_certbot_main_dir}/archive"
$ng_certbot_check = "${ng_certbot_archive}/${ng_webserver_name}/cert1.pem"
$ng_certbot_live = "${ng_certbot_main_dir}/live"
$ng_certbot_main_dir = '/etc/letsencrypt'
$ng_certbot_archive = "${ng_certbot_main_dir}/archive"
$ng_certbot_check = "${ng_certbot_archive}/${ng_webserver_name}/cert1.pem"
$ng_certbot_live = "${ng_certbot_main_dir}/live"
# nagios
$ng_target_templates = "${ng_conf_d_dir}/templates.cfg"
$ng_target_timeperiods = "${ng_conf_d_dir}/timeperiods.cfg"
$ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg"
$ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg"
$ng_target_hostgroup = "${ng_conf_d_dir}/nagios_hostgroup.cfg"
$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_servicegroup = "${ng_conf_d_dir}/nagios_servicegroup.cfg"
$ng_target_contact = "${ng_conf_d_dir}/nagios_contact.cfg"
$ng_target_contactgroup = "${ng_conf_d_dir}/nagios_contactgroup.cfg"
$ng_target_command = "${ng_conf_d_dir}/nagios_command.cfg"
# includes must be last

View File

@@ -37,6 +37,20 @@ class cd_nagios::server::files (
# manage nagios.cfg
file { $ng_nagios_cfg_file:
ensure => file,
path => $ng_nagios_cfg_file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => nagios_etc_t,
seluser => system_u,
content => template($ng_nagios_cfg_erb),
notify => Service[$ng_service],
}
# manage cgi.cfg
file { $ng_cgi_cfg_file:
@@ -53,20 +67,11 @@ class cd_nagios::server::files (
notify => Service[$ng_service],
}
# manage nagios.conf for httpd
# since we use vhost files, we do not want the regular file to appear
# after upgrades to avoid conflicts
file { $ng_nagios_conf:
ensure => absent,
# path => $ng_nagios_conf,
# owner => 'root',
# group => 'root',
# mode => '0644',
# selrange => s0,
# selrole => object_r,
# seltype => httpd_config_t,
# seluser => system_u,
# content => template($ng_nagios_conf_erb),
# notify => Service[$ae_service],
}
file { $ng_forward_conf:

View File

@@ -35,5 +35,55 @@ class cd_nagios::server::service (
hasrestart => true,
enable => true,
}
@@nagios_service { "check_nagios${::hostname}":
check_command => 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios',
use => 'generic-service',
host_name => $::fqdn,
notification_period => '24x7',
target => $ng_target_service,
owner => 'nagios',
group => 'nagios',
mode => '660',
contacts => 'DevOps',
}
resources { [ 'nagios_host',
'nagios_hostgroup',
'nagios_hostdependency',
'nagios_hostescalation',
'nagios_hostextinfo',
'nagios_service',
'nagios_servicegroup',
'nagios_servicedependency',
'nagios_serviceescalation',
'nagios_serviceextinfo',
'nagios_contact',
'nagios_contactgroup',
'nagios_command',
'nagios_timeperiod' ]:
purge => true,
}
# collect resources and populate /etc/nagios/conf.d/nagios_*.cfg
Nagios_host <<||>> { notify => Service['nagios'] }
Nagios_hostgroup <<||>> { notify => Service['nagios'] }
Nagios_hostdependency <<||>> { notify => Service['nagios'] }
Nagios_hostescalation <<||>> { notify => Service['nagios'] }
Nagios_hostextinfo <<||>> { notify => Service['nagios'] }
Nagios_service <<||>> { notify => Service['nagios'] }
Nagios_servicegroup <<||>> { notify => Service['nagios'] }
Nagios_servicedependency <<||>> { notify => Service['nagios'] }
Nagios_serviceescalation <<||>> { notify => Service['nagios'] }
Nagios_serviceextinfo <<||>> { notify => Service['nagios'] }
Nagios_contact <<||>> { notify => Service['nagios'] }
Nagios_contactgroup <<||>> { notify => Service['nagios'] }
Nagios_command <<||>> { notify => Service['nagios'] }
Nagios_timeperiod <<||>> { notify => Service['nagios'] }
}
}
}