diff --git a/CHANGELOG.md b/CHANGELOG.md index d43c4ab..9d4a42d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ Changelog of Git Changelog.
+
+
Service * manage Nagios service on server @@ -231,12 +233,12 @@ Requires puppetlabs firewall or cd_firewall, -which is a clone of the puppetlabs firewall but tested to be fully -functioning with all our features.
+which is a backdated clone of the puppetlabs firewall but tested to be +fully functioning with all our features.See the full -list of all available parameters
+list of all available parameters.Service * manage Nagios service on server @@ -231,12 +233,12 @@ Requires puppetlabs firewall or cd_firewall, -which is a clone of the puppetlabs firewall but tested to be fully -functioning with all our features.
+which is a backdated clone of the puppetlabs firewall but tested to be +fully functioning with all our features.See the full -list of all available parameters
+list of all available parameters.main log file where service- and host events +are logged.
+maximum amount of checks done by nagios
+determines where object definitions are +cached when # Nagios +starts/restarts.
+determines the location of the +precached object file.
+resource file that contains $USERx$ macro definitions.
+where the current status of all monitored +services and hosts is stored.
+status file update interval. +determines the frequency (in seconds) that # +Nagios will periodically dump +program, host, and # service status data.
+allows you to specify whether or not
+Nagios should check # for external
+commands in the command file specified
+by 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.
+Whether to enable the query handler +for running nagios in cluster mode.
+the socket for the query handler
+lockfile that Nagios will use to store its PID +number in when it is running +in daemon mode.
+temporary file that is used as scratch space +when Nagios # updates the +status log, cleans the comment file, etc.
+path where Nagios can create temp files for +service and # host check +results, etc.
+Controls what (if any) data gets sent +to the event broker.
+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']
+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)
+directory where archived (rotated) +log files should be # placed (assuming +you've chosen to do log rotation).
+whether to log messages to the syslog
+facility, as well as the Nagios log
+file. Valid options are 0 and 1.
Whether to log notifications in addition
+to regular messages. Valid options
+are 0 and 1.
Whether to log service retries.
+Valid options are 0 and
+1.
Whether to log host retries.
+Valid options are 0 and
+1.
Whether to log host and service event
+handlers. Valid options are
+0 and 1.
Whether to log initial states.
+Valid options are 0 and
+1.
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.
Whether to log external commands.
+Valid options are 0 and
+1.
Whether to log passive checks.
+Valid options are 0 and
+1.
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.
+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.
+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
+timeframe (in minutes) from the +program start time that an initial check of +all services should be completed
+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.
+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
+timeframe (in minutes) from the +program start time that an initial check of +all hosts should # be completed.
+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.
+frequency (in seconds!) in which +Nagios will process the results of host +and service checks.
+directory where Nagios stores the +results of host and service checks that +have not yet been processed.
+maximum age (in seconds) which +check result files are considered to be +valid.
+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.
+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.
+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.
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.
Whether or not Nagios will use
+soft state information when checking host
+and service dependencies.
+Valid options are 0 and
+1.
when Nagios will react to detected +changes in system time (either forward +or backwards).
+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.
how often (in seconds) Nagios will
+attempt to automatically reschedule
+checks. only has an effect if
+ng_auto_reschedule_checks is set
+to 1.
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.
+-216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 357 358 359 @@ -2161,127 +3117,386 @@ required for certbot and used in the web templates. 395 396 397 -398+398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607
# File 'manifests/params.pp', line 216 +# File 'manifests/params.pp', line 357 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', ) { @@ -2298,50 +3513,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 @@ -2356,7 +3589,7 @@ $ng_certbot_live = "${ng_certbot_main_dir}/live" diff --git a/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html index 6b4a233..568d40c 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html +++ b/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html @@ -249,7 +249,7 @@ class cd_nagios::selinux::config ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html index 97a60a4..2591d9e 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html @@ -195,7 +195,7 @@ class cd_nagios::server::access_rules ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html index c1e65c0..6c67318 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html @@ -220,7 +220,12 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/. 111 112 113 -114+114 +115 +116 +117 +118 +119
# File 'manifests/server/files.pp', line 23 @@ -242,6 +247,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: @@ -258,20 +277,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: @@ -324,7 +334,7 @@ class cd_nagios::server::files ( diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html index 953649f..f36cbab 100644 --- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html +++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html @@ -145,7 +145,53 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/. 36 37 38 -39+39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85
# File 'manifests/server/service.pp', line 23
@@ -165,6 +211,52 @@ 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'] }
+
}
}