89 lines
1.6 KiB
YAML
89 lines
1.6 KiB
YAML
|
---
|
||
|
# defaults file for jtom38/monit
|
||
|
|
||
|
monit_slack_alert_script: /etc/monit/scripts/slack.sh
|
||
|
monit_discord_alert_script: /etc/monit/scripts/discord.sh
|
||
|
|
||
|
monit_global:
|
||
|
check_interval: 120
|
||
|
log_file: /var/lib/monit/state
|
||
|
statefile: /var/lib/monit/state
|
||
|
eventqueue:
|
||
|
basedir: /var/lib/monit/events
|
||
|
slots: 100
|
||
|
|
||
|
monit_alert_slack:
|
||
|
deploy: false
|
||
|
webhook_token: ''
|
||
|
slack_instance: ''
|
||
|
channel: "#alerts"
|
||
|
username: "Monit"
|
||
|
|
||
|
monit_alert_discord:
|
||
|
deploy: false
|
||
|
webhook: ''
|
||
|
username: 'Monit'
|
||
|
|
||
|
monit_http:
|
||
|
port: 2812
|
||
|
username: admin
|
||
|
password: monit
|
||
|
|
||
|
monit_processes:
|
||
|
- name: ssh
|
||
|
pidfile: '/var/run/sshd.pid'
|
||
|
matching: ''
|
||
|
start: '/bin/systemctl start ssh'
|
||
|
stop: '/bin/systemctl stop ssh'
|
||
|
timeout: '30 seconds'
|
||
|
when:
|
||
|
- type: 'totalmem'
|
||
|
usage: '> 80%'
|
||
|
cycles: 1
|
||
|
alert: false
|
||
|
exec: "{{ monit_discord_alert_script }}"
|
||
|
|
||
|
monit_filesystems:
|
||
|
- name: root
|
||
|
path: /
|
||
|
when:
|
||
|
- usage: '> 80%'
|
||
|
tries: 1
|
||
|
cycles: 1
|
||
|
alert: false
|
||
|
exec: ""
|
||
|
|
||
|
monit_system:
|
||
|
hostname: "{{ ansible_hostname }}"
|
||
|
when:
|
||
|
- type: cpu
|
||
|
usage: "usage (user) > 80%"
|
||
|
cycles: 5
|
||
|
alert: false
|
||
|
exec: ""
|
||
|
- type: cpu
|
||
|
usage: "usage (system) > 30%"
|
||
|
cycles: 5
|
||
|
alert: false
|
||
|
exec: ""
|
||
|
- type: cpu
|
||
|
usage: "usage (wait) > 20%"
|
||
|
cycles: 5
|
||
|
alert: false
|
||
|
exec: ""
|
||
|
|
||
|
- type: memory
|
||
|
usage: "usage > 90%"
|
||
|
cycles: 5
|
||
|
alert: false
|
||
|
exec: ""
|
||
|
- type: swap
|
||
|
usage: "usage > 25%"
|
||
|
cycles: 5
|
||
|
alert: false
|
||
|
exec: ""
|
||
|
- type: "loadavg(5min)"
|
||
|
usage: "> 1"
|
||
|
cycles: 5
|
||
|
alert: false
|
||
|
exec: ""
|