diff --git a/manifests/params.pp b/manifests/params.pp index 13628b9..f4c932d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -123,6 +123,7 @@ class confdroid_nagios::params ( Boolean $ng_enable_target = true, Boolean $ng_purge_target = true, + # contact groups String $ng_contactgroup_name = 'admins', String $ng_contactgroup_alias = 'Nagios Administrators', @@ -254,7 +255,8 @@ class confdroid_nagios::params ( $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_log_dir}/status.dat" + $ng_status_file = "${ng_spool_dir}/status.dat" + $ng_command_file = "${ng_cmd_dir}/nagios.cmd" ## old $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb' diff --git a/templates/nagios/nagios_cfg.erb b/templates/nagios/nagios_cfg.erb index 1d1a31e..3c29461 100644 --- a/templates/nagios/nagios_cfg.erb +++ b/templates/nagios/nagios_cfg.erb @@ -14,121 +14,27 @@ log_file=<%= @ng_log_file %> # Original files are available at https://3for.me/hn6ca (membership area) # or at nagios.org -# Definitions for monitoring a Windows machine -#cfg_file=/etc/nagios/objects/windows.cfg - -# Definitions for monitoring a router/switch -#cfg_file=/etc/nagios/objects/switch.cfg - -# Definitions for monitoring a network printer -#cfg_file=/etc/nagios/objects/printer.cfg - cfg_dir=<%= @ng_conf_d_dir %> +object_cache_file=<%= @ng_object_cache_file %> -# OBJECT CACHE FILE -# This option determines where object definitions are cached when -# Nagios starts/restarts. The CGIs read object definitions from -# this cache file (rather than looking at the object config files -# directly) in order to prevent inconsistencies that can occur -# when the config files are modified after Nagios starts. +precached_object_file=<%= @ng_precached_obj_file %> -object_cache_file=/var/spool/nagios/objects.cache +resource_file=<%= @ng_resource_file %> +status_file=<%= @$ng_status_file %> +status_update_interval=<%= @ng_status_upd_interval %> -# PRE-CACHED OBJECT FILE -# This options determines the location of the precached object file. -# If you run Nagios with the -p command line option, it will preprocess -# your object configuration file(s) and write the cached config to this -# file. You can then start Nagios with the -u option to have it read -# object definitions from this precached file, rather than the standard -# object configuration files (see the cfg_file and cfg_dir options above). -# Using a precached object file can speed up the time needed to (re)start -# the Nagios process if you've got a large and/or complex configuration. -# Read the documentation section on optimizing Nagios to find our more -# about how this feature works. +nagios_user=<%= @ng_user %> -precached_object_file=/var/spool/nagios/objects.precache +nagios_group=<%= @ng_user %> +check_external_commands=<%= @ng_check_ext_commands %> +command_file=<%= @ng_command_file %> -# RESOURCE FILE -# This is an optional resource file that contains $USERx$ macro -# definitions. Multiple resource files can be specified by using -# multiple resource_file definitions. The CGIs will not attempt to -# read the contents of resource files, so information that is -# considered to be sensitive (usernames, passwords, etc) can be -# defined as macros in this file and restrictive permissions (600) -# can be placed on this file. - -resource_file=/etc/nagios/private/resource.cfg - - - -# STATUS FILE -# This is where the current status of all monitored services and -# hosts is stored. Its contents are read and processed by the CGIs. -# The contents of the status file are deleted every time Nagios -# restarts. - -status_file=/var/spool/nagios/status.dat - - - -# STATUS FILE UPDATE INTERVAL -# This option determines the frequency (in seconds) that -# Nagios will periodically dump program, host, and -# service status data. - -status_update_interval=10 - - - -# NAGIOS USER -# This determines the effective user that Nagios should run as. -# You can either supply a username or a UID. - -nagios_user=nagios - - - -# NAGIOS GROUP -# This determines the effective group that Nagios should run as. -# You can either supply a group name or a GID. - -nagios_group=nagios - - - -# EXTERNAL COMMAND OPTION -# This option allows you to specify whether or not Nagios should check -# for external commands (in the command file defined below). -# By default Nagios will check for external commands. -# If you want to be able to use the CGI command interface -# you will have to enable this. -# Values: 0 = disable commands, 1 = enable commands - -check_external_commands=1 - - - -# EXTERNAL COMMAND FILE -# This is the 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 (usually 'nobody'). Permissions should be set at the -# directory level instead of on the file, as the file is deleted every -# time its contents are processed. - -command_file=/var/spool/nagios/cmd/nagios.cmd - - - -# QUERY HANDLER INTERFACE -# This is the socket that is created for the Query Handler interface - -#query_socket=/var/spool/nagios/cmd/nagios.qh +query_socket=<%= @ng_cmd_dir %>/nagios.qh