diff --git a/roles/common/tasks/monit.yml b/roles/common/tasks/monit.yml index 9d26e1b..87a5755 100644 --- a/roles/common/tasks/monit.yml +++ b/roles/common/tasks/monit.yml @@ -1,34 +1,37 @@ --- - name: Create nagios directory file: state="directory" path="/etc/nagios" +- name: Create nrpe config directory + file: state=directory path=/etc/nagios/nrpe.d owner=nagios group=nagios + - name: Create user nrpe user: name=nrpe - name: Monitoring task template: src: nrpe_local.cfg dest: /etc/nagios/nrpe_local.cfg owner: nrpe group: nrpe mode: 0640 notify: restart nrpe - name: Memory check for nagios template: src: check_mem.sh dest: /usr/local/bin/check_mem.sh owner: nrpe group: nrpe mode: 0750 - name: Remote logging with rsyslog lineinfile: dest: /etc/rsyslog.conf line: "{{ item }}" state: present with_items: - '$ModLoad imklog' - "*.* @{{ groups['monit'][0] }}:514" notify: restart rsyslog when: "inventory_hostname != groups.monit[0]"