Add a default commands.cfg deployment to be placed in /etc/nrpe.d

parent e7ce4937
......@@ -40,22 +40,22 @@ allow_weak_random_seed: 0
# NOTE: This option is ignored if NRPE is running under either inetd
# or xinetd or systemd
allowed_hosts:
- 127.0.0.1
- ::1
- 127.0.0.1
- ::1
# The following examples use hardcoded command arguments...
# This is by far the most secure method of using NRPE
command:
- name: check_users
command: /usr/lib64/nagios/plugins/check_users -w 5 -c 10
- name: check_load
command: /usr/lib64/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20
- name: check_hda1
command: /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
- name: check_zombie_procs
command: /usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
- name: check_total_procs
command: /usr/lib64/nagios/plugins/check_procs -w 150 -c 200
commands:
- name: check_users
command: /usr/lib64/nagios/plugins/check_users -w 5 -c 10
- name: check_load
command: /usr/lib64/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20
- name: check_hda1
command: /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
- name: check_zombie_procs
command: /usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
- name: check_total_procs
command: /usr/lib64/nagios/plugins/check_procs -w 150 -c 200
# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
......@@ -172,7 +172,7 @@ include: []
# This directive allows you to include definitions from config files (with a
# .cfg extension) in one or more directories (with recursion).
include_dir:
- /etc/nrpe.d
- /etc/nrpe.d
# LISTEN QUEUE SIZE
# Listen queue size (backlog) for serving incoming connections.
......@@ -293,6 +293,7 @@ ssl_use_adh: 1
ssl_version: TLSv1+
############# OTHER ROLE-BASED OPTIONS
extra_config_files: []
extra_config_files:
- commands.cfg
nrpe_autostart: True
......@@ -40,24 +40,15 @@
state: latest
update_cache: yes
become: yes
# - name: Install custom nrpe.cfg
# template:
# src: templates/etc/nagios/nrpe.cfg
# dest: /etc/nagios/nrpe.cfg
# owner: root
# group: root
# mode: 0644
# register: nrpe_cfg_file
# become: yes
- name: Install extra config files
copy:
src: "{{ config_file }}"
template:
src: "{{ config_file }}.j2"
dest: "/etc/nrpe.d/{{ config_file | basename }}"
owner: root
group: root
mode: 0644
with_items: "{{ extra_config_files }}"
loop: "{{ extra_config_files }}"
loop_control:
loop_var: config_file
register: nrpe_extra_cfg_file
......
{% for command in commands %}
command[{{ command.name }}]={{ command.command }}
{% endfor %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment