2023-10-23 12:17:20 +00:00
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# Install and configure NAGIOS-NRPE
|
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# paso1
|
|
|
|
# install packages for nagios-nrpe
|
|
|
|
- name: install packages for nagios-nrpe (nagios-nrpe-server nagios-nrpe-plugin)
|
|
|
|
apt:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- nagios-nrpe-server
|
|
|
|
- nagios-nrpe-plugin
|
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# paso2
|
|
|
|
# copy file 90-vn.cfg to /etc/nagios/nrpe.d/
|
|
|
|
- name: copy file 90-vn.cfg to /etc/nagios/nrpe.d/
|
|
|
|
copy:
|
|
|
|
src: 90-vn.cfg
|
|
|
|
dest: /etc/nagios/nrpe.d/90-vn.cfg
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '0644'
|
2023-10-23 12:25:47 +00:00
|
|
|
# backup: yes # NO BACKUPS
|
2023-10-23 12:17:20 +00:00
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# paso3
|
|
|
|
# create file 99-local.cfg to /etc/nagios/nrpe.d/
|
|
|
|
- name: create 99-local.cfg to /etc/nagios/nrpe.d/
|
|
|
|
file:
|
2023-10-23 12:24:13 +00:00
|
|
|
path: "{{ local_path }}"
|
2023-10-23 12:17:20 +00:00
|
|
|
state: touch
|
|
|
|
mode: '0644'
|
|
|
|
notify: restart nagios-nrpe
|
2023-10-23 15:17:28 +00:00
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# service should start on boot.
|
|
|
|
- name: service should start on boot
|
|
|
|
service:
|
|
|
|
name: "{{ nagios_nrpe_daemon }}"
|
|
|
|
enabled: yes
|
2023-10-23 12:17:20 +00:00
|
|
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|