-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.yml
195 lines (173 loc) · 8.31 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
---
# Configuration repositories, defined in host vars file
nagios_config_cfg_dirs_git: []
nagios_config_cfg_dirs_git_rsa: []
# Configure notification command
# disable this when you use pnp4nagios ansible role that changes the notification commands
nagios_config_configure_notifications_command: True
nagios_config_configure_generic_host_service: True
# Extra Nagios configuration options
nagios_config_enable_notifications: 1
nagios_cgi_authorized_for_system_information: nagiosadmin
nagios_cgi_authorized_for_configuration_information: nagiosadmin
nagios_cgi_authorized_for_system_commands: nagiosadmin
nagios_cgi_authorized_for_all_services: nagiosadmin
nagios_cgi_authorized_for_all_hosts: nagiosadmin
nagios_cgi_authorized_for_all_service_commands: nagiosadmin
nagios_cgi_authorized_for_all_host_commands: nagiosadmin
nagios_cgi_authorized_for_read_only: False
# Cron customized settings
# will execute tasks/nagios_cron.yml task to enable daily compress of {{ nagios_config_archives_dir }}
# This will free lot of RAM Memory usage when logs are too high on large environments
nagios_config_gzip_archives: False
nagios_config_gzip_archives_days: 180 # days older to compress with gzip the file
nagios_config_archives_dir: "/usr/local/nagios/var/archives" # location to nagios archives logs
nagios_config_archives_dir_compressed: "/usr/local/nagios/var/archives_comp" # location to nagios archives logs compressed
# Default proxy_env
proxy_env:
http_proxy: ''
https_proxy: ''
ftp_proxy: ''
# Standard Nagios configuration options
nagios_config_nagios_user: nagios
nagios_config_nagios_group: nagios
nagios_config_check_external_commands: 1 # Nagios default configuration = 1
nagios_config_use_syslog: 0
nagios_config_log_notifications: 1
nagios_config_log_initial_states: 1 # Nagios default
nagios_config_log_external_commands: 1
nagios_config_enable_flap_detection: 1
nagios_config_service_inter_check_delay_method: s
nagios_config_retain_state_information: 1
nagios_config_use_retained_scheduling_info: 1
nagios_config_interval_length: 60
nagios_config_check_for_updates: 0
nagios_config_process_performance_data: 1
nagios_config_use_regexp_matching: 0
nagios_config_admin_email: root@localhost
nagios_config_admin_pager: pageroot@localhost
nagios_config_log_rotation_method: h
nagios_check_service_freshness: 1
nagios_allow_empty_hostgroup_assignment: 1
# Performance:
# https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/tuning.html
nagios_config_use_large_installation_tweaks: 1
nagios_config_enable_environment_macros: 1 # required for pnp4n_send_service_mail.pl but possible instability with check-mk-livestatus
nagios_config_free_child_process_memory: 1
#nagios_config_child_processes_fork_twice: 1
nagios_cached_host_check_horizon: 90
nagios_cached_service_check_horizon: 90
nagios_config_max_concurrent_checks: 100
nagios_config_status_update_interval: 120
nagios_service_freshness_check_interval: 120
nagios_host_freshness_check_interval: 120
nagios_config_perf_options:
- key: check_result_reaper_frequency
value: 3
- key: max_check_result_reaper_time
value: 10
# Standard NSCA configuration options
nsca_config_log_facility: daemon
nsca_config_check_result_path: False
nsca_config_pid_file: /var/run/nsca.pid
nsca_config_server_port: 5667
nsca_config_server_address: False
nsca_config_nsca_user: nagios
nsca_config_nsca_group: nagios
nsca_config_nsca_chroot: False
nsca_config_debug: 0
nsca_config_command_file: "{{ nagios_config_command_file }}"
nsca_config_alternate_dump_file: /var/run/nagios/nsca.dump
nsca_config_aggregate_writes: 0
nsca_config_append_to_file: 0
nsca_config_max_packet_age: 30
nsca_config_password: False
nsca_config_decryption_method: 1
# Not required for normal nagios without pnp or check-mk
#nagios_config_host_perfdata_file_processing_command: process-host-perfdata-file
#nagios_config_service_perfdata_file_processing_command: process-service-perfdata-file
#nagios_config_global_host_event_handler: somecommand
#nagios_config_global_service_event_handler: somecommand
#nagios_config_broker_module: /somewhere/module2.o arg1 arg2=3 debug=0
#nagios_config_host_perfdata_file_processing_interval: false
#nagios_config_service_perfdata_file_processing_interval: false
# nagios_config_host_perfdata_file_template: DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
# nagios_config_service_perfdata_file_template: DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
# Standard CGI configuration options
nagios_cgi_show_context_help: 1
nagios_cgi_use_pending_states: 1
nagios_cgi_statusmap_background_image: False
# DEFAULT STATUSMAP LAYOUT METHOD
# This option allows you to specify the default layout method
# the statusmap CGI should use for drawing hosts. If you do
# not use this option, the default is to use user-defined
# coordinates. Valid options are as follows:
# 0 = User-defined coordinates
# 1 = Depth layers
# 2 = Collapsed tree
# 3 = Balanced tree
# 4 = Circular
# 5 = Circular (Marked Up)
nagios_cgi_default_statusmap_layout: 4
nagios_cgi_refresh_rate: 90
nagios_cgi_result_limit: 100
# ESCAPE HTML TAGS
# This option determines whether HTML tags in host and service
# status output is escaped in the web interface. If enabled,
# your plugin output will not be able to contain clickable links.
nagios_cgi_escape_html_tags: 1
nagios_cgi_host_unreachable_sound: False
nagios_cgi_host_down_sound: False
nagios_cgi_service_critical_sound: False
nagios_cgi_service_warning_sound: False
nagios_cgi_service_unknown_sound: False
nagios_cgi_normal_sound: False
# Apache configuration options
nagios_a2_config: True # Set to False to not configure Apache
nagios_a2_vhost_file: 00-nagios.conf
nagios_a2_http_port: 80
nagios_a2_https_port: 443
nagios_a2_server_name: "{{ ansible_fqdn }}"
nagios_a2_server_admin: root@localhost
nagios_a2_ssl_cert_file: /etc/ssl/certs/ssl-cert-snakeoil.pem
nagios_a2_ssl_cert_keyfile: /etc/ssl/private/ssl-cert-snakeoil.key
# Templates configurations
generic_service_check_interval: 5 # check interval for services template in minutes
nagios_config_generic_host_lines:
- 'name generic-host ; The name of this host template'
- 'notifications_enabled 1 ; Host notifications are enabled'
- 'event_handler_enabled 1 ; Host event handler is enabled'
- 'flap_detection_enabled 1 ; Flap detection is enabled'
- 'process_perf_data 1 ; Process performance data'
- 'retain_status_information 1 ; Retain status information across program restarts'
- 'retain_nonstatus_information 1 ; Retain non-status information across program restarts'
- 'check_command check_icmp'
- 'max_check_attempts 2'
- 'notification_interval 0'
- 'notification_period 24x7'
- 'notification_options d,u,r'
- 'contact_groups admins'
nagios_config_commands_nrpe_port: 5666
# some configurable nagios services, there are others not configurable in localhost_nagios.cfg.j2 template
nagios_localhost_services:
- 'define service {'
- 'host_name localhost'
- 'service_description Check if Apache2 is running'
- 'check_command check_linux_process_local!419430400!536870912!/var/run/{{ apache_service }}/{{ apache_service }}.pid'
- 'use generic-service'
- '}'
- ''
- 'define service {'
- 'host_name localhost'
- 'service_description Check if Nagios is running'
- 'check_command check_linux_process_local!6442450944!7442450944!/run/nagios.lock'
- 'notes Warn if nagios uses 6.5Gb of RAM. CRIT 7Gb of RAM'
- 'use generic-service'
- '}'
- ''
- 'define service {'
- 'host_name localhost'
- 'service_description check_nsca_service_running'
- 'check_command check_linux_process_local!6442450944!7442450944!/var/run/nsca.pid'
- 'use generic-service'
- '}'