ansible-roles/nagios/tasks/hardware-checks.yml

46 lines
1.2 KiB
YAML

---
# The original check_linux_raid is often buggy
- name: Install some plugins that check hardware parts
copy: src={{ item }} dest={{ nagios_isti_plugdir }}/{{ item }} owner=root group=nagios mode=0750
with_items:
- check_linux_raid
- check_smart
tags:
- nagios-hw
- nagios
- name: Install some packages needed by the hardware checks
apt: pkg={{ item }} state=installed
with_items:
- smartmontools
tags:
- nagios-hw
- nagios
- name: Configure the smart server to run
lineinfile: name=/etc/default/smartmontools regexp="^start_smartd=" line="start_smartd=yes"
tags:
- nagios-hw
- nagios
- name: Ensure that the smart server is enabled and running
service: name=smartmontools state=started enabled=yes
tags:
- nagios-hw
- nagios
- name: Configure NRPE to allow arguments. Needed by the check_smart plugin
lineinfile: name=/etc/nagios/nrpe.cfg regexp="^dont_blame_nrpe=" line="dont_blame_nrpe=0"
notify: Restart NRPE server
tags:
- nagios-hw
- nagios
- nrpe
- name: nagios needs root to execute some hardware checks. We do it via sudo
template: src=nagios-hw.sudoers.j2 dest=/etc/sudoers.d/nagios-hw owner=root group=root mode=0440
tags:
- nagios-hw
- nagios
- nrpe