2019-11-22 20:58:26 +00:00
|
|
|
---
|
|
|
|
check_interval: 5
|
2019-09-21 22:03:26 +00:00
|
|
|
|
|
|
|
monitors:
|
2019-11-22 20:58:26 +00:00
|
|
|
- name: Fake Website
|
|
|
|
command: ['curl', '-s', '-o', '/dev/null', 'https://minitor.mon']
|
|
|
|
alert_down: [log_down, mailgun_down, sms_down]
|
|
|
|
alert_up: [log_up, email_up]
|
|
|
|
check_interval: 10 # Must be at minimum the global `check_interval`
|
2019-09-21 22:03:26 +00:00
|
|
|
alert_after: 3
|
2019-11-22 20:58:26 +00:00
|
|
|
alert_every: -1 # Defaults to -1 for exponential backoff. 0 to disable repeating
|
|
|
|
- name: Real Website
|
|
|
|
command: ['curl', '-s', '-o', '/dev/null', 'https://google.com']
|
|
|
|
alert_down: [log_down, mailgun_down, sms_down]
|
|
|
|
alert_up: [log_up, email_up]
|
|
|
|
check_interval: 5
|
|
|
|
alert_after: 3
|
|
|
|
alert_every: -1
|
2019-09-21 22:03:26 +00:00
|
|
|
|
|
|
|
alerts:
|
2019-11-22 20:58:26 +00:00
|
|
|
log_down:
|
|
|
|
command: ["echo", "Minitor failure for {{.MonitorName}}"]
|
|
|
|
log_up:
|
|
|
|
command: ["echo", "Minitor recovery for {{.MonitorName}}"]
|
2019-09-21 22:03:26 +00:00
|
|
|
email_up:
|
2019-11-22 20:58:26 +00:00
|
|
|
command: [sendmail, "me@minitor.mon", "Recovered: {monitor_name}", "We're back!"]
|
2019-09-21 22:03:26 +00:00
|
|
|
mailgun_down:
|
2019-11-22 20:58:26 +00:00
|
|
|
command_shell: >
|
2019-09-21 22:03:26 +00:00
|
|
|
curl -s -X POST
|
2019-11-22 20:58:26 +00:00
|
|
|
-F subject="Alert! {{.MonitorName}} failed"
|
2019-09-21 22:03:26 +00:00
|
|
|
-F from="Minitor <minitor@minitor.mon>"
|
|
|
|
-F to=me@minitor.mon
|
|
|
|
-F text="Our monitor failed"
|
|
|
|
https://api.mailgun.net/v3/minitor.mon/messages
|
|
|
|
-u "api:${MAILGUN_API_KEY}"
|
|
|
|
sms_down:
|
2019-11-22 20:58:26 +00:00
|
|
|
command_shell: >
|
|
|
|
curl -s -X POST -F "Body=Failure! {{.MonitorName}} has failed"
|
2019-09-21 22:03:26 +00:00
|
|
|
-F "From=${AVAILABLE_NUMBER}" -F "To=${MY_PHONE}"
|
|
|
|
"https://api.twilio.com/2010-04-01/Accounts/${ACCOUNT_SID}/Messages"
|
|
|
|
-u "${ACCOUNT_SID}:${AUTH_TOKEN}"
|