Browse Source

Add logwatch to the monitoring role to email daily log summaries

Based on playbook from https://github.com/phred/5minbootstrap
cji 11 years ago
parent
commit
ba901526b7
2 changed files with 7 additions and 1 deletions
  1. 5
    0
      roles/monitoring/tasks/logwatch.yml
  2. 2
    1
      roles/monitoring/tasks/main.yml

+ 5
- 0
roles/monitoring/tasks/logwatch.yml View File

1
+- name: Install logwatch
2
+  apt: pkg=logwatch state=installed
3
+
4
+- name: Configure logwatch to email {{ main_user_name }}@{{ domain }} daily
5
+  action: lineinfile dest=/etc/cron.daily/00logwatch regexp="^/usr/sbin/logwatch" line="/usr/sbin/logwatch --output mail --mailto {{ main_user_name }}@{{ domain }} --detail high" state=present create=yes

+ 2
- 1
roles/monitoring/tasks/main.yml View File

1
-- include: monit.yml tags=monit
1
+- include: monit.yml tags=monit
2
+- include: logwatch.yml tags=logwatch

Loading…
Cancel
Save