59 lines
1.1 KiB
YAML
59 lines
1.1 KiB
YAML
---
|
|
- name: Install nrpe
|
|
openbsd_pkg:
|
|
name:
|
|
- nrpe--
|
|
state: present
|
|
|
|
- name: Install monitoring-plugins
|
|
openbsd_pkg:
|
|
name:
|
|
- monitoring-plugins
|
|
state: present
|
|
|
|
- name: Create nrpe.d dir
|
|
file:
|
|
path: /etc/nrpe.d
|
|
state: directory
|
|
owner: root
|
|
group: wheel
|
|
mode: "0755"
|
|
|
|
- name: Include nrpe.d dir in nrpe.cfg
|
|
lineinfile:
|
|
dest: /etc/nrpe.cfg
|
|
line: 'include_dir=/etc/nrpe.d'
|
|
|
|
- name: custom configuration is present
|
|
template:
|
|
src: evolix_bsd.cfg.j2
|
|
dest: /etc/nrpe.d/evolix.cfg
|
|
notify: restart nrpe
|
|
|
|
- name: Nagios plugins are installed
|
|
copy:
|
|
src: plugins_bsd/
|
|
dest: /usr/local/libexec/nagios/plugins/
|
|
owner: root
|
|
group: wheel
|
|
mode: "0755"
|
|
notify: restart nrpe
|
|
|
|
- name: Nagios plugins are installed - template
|
|
template:
|
|
src: plugins_bsd/{{ item }}.j2
|
|
dest: /usr/local/libexec/nagios/plugins/{{ item }}
|
|
owner: root
|
|
group: wheel
|
|
mode: "0755"
|
|
with_items:
|
|
- 'check_pf_states'
|
|
- 'check_free_mem.sh'
|
|
notify: restart nrpe
|
|
|
|
- name: Starting and enabling nrpe
|
|
service:
|
|
name: nrpe
|
|
enabled: true
|
|
state: started
|