Example of a working use of this app via docker #146
-
|
Looking to get started with this, Is there a working example for a user or the author that has more then one check? Would like to see multiple FileSystems, Multiple containers, and etc. Looks like the app Gotify which utilizes curl to send notifs will work well with this. Anyone implementing this app already? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 18 replies
-
|
That's the config I'm using on one of my servers (with some small changes for privacy reasons): [log]
level = "Info"
[[report.events]]
name = "Report"
action = "Telegram report"
[[checks]]
interval = 3600
name = "Disk usage"
type = "FilesystemUsage"
mountpoints = ["/"]
[[checks.alarms]]
name = "Warning"
level = 75
repeat_cycles = 24
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 24
error_action = "Telegram alarm"
[[checks.alarms]]
name = "Critical"
level = 90
repeat_cycles = 24
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 24
error_action = "Telegram alarm"
[[checks]]
interval = 60
name = "Memory usage"
type = "MemoryUsage"
memory = true
[[checks.alarms]]
name = "Warning"
level = 75
cycles = 5
repeat_cycles = 1440
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 1440
error_action = "Telegram alarm"
[[checks.alarms]]
name = "Critical"
level = 90
cycles = 5
repeat_cycles = 1440
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 1440
error_action = "Telegram alarm"
[[checks]]
interval = 60
name = "Pressure average"
type = "PressureAverage"
cpu = true
io = "Some"
memory = "Some"
avg60 = true
[[checks.alarms]]
name = "Warning"
level = 75
cycles = 5
repeat_cycles = 1440
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 1440
error_action = "Telegram alarm"
[[checks.alarms]]
name = "Critical"
level = 90
cycles = 5
repeat_cycles = 1440
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 1440
error_action = "Telegram alarm"
[[checks]]
interval = 300
name = "Podman service"
type = "SystemdUnitStatus"
units = [
{unit = "container-a.service", uid = 900},
{unit = "pod-a.service", uid = 901},
{unit = "pod-b.service", uid = 902},
{unit = "pod-c.service", uid = 903},
{unit = "container-b.service", uid = 904}
]
[[checks.alarms]]
name = "Error"
repeat_cycles = 288
action = "Telegram alarm"
recover_action = "Telegram alarm"
error_repeat_cycles = 288
error_action = "Telegram alarm"
[[actions]]
name = "Telegram alarm"
type = "Webhook"
url = "https://telepush.dev/api/messages/123456"
headers = {"Content-Type" = "application/json"}
body = """{"text": "Alarm *{{alarm_name}}*, id *{{check_id}}* from check *{{check_name}}* changed state to *{{alarm_state}}*."}"""
[[actions]]
name = "Telegram report"
type = "Webhook"
url = "https://telepush.dev/api/messages/123456"
headers = {"Content-Type" = "application/json"}
body = """{"text": "Monitoring on example.com is running since {{minmon_uptime_iso}}! System is up since {{system_uptime_iso}}."}"""Gotify should be easy to setup with the Webhook action. Personally I really like the pressure (PSI) metric. It reliably predicts when problems are getting worse and you have to act before something goes down uncontrolled. |
Beta Was this translation helpful? Give feedback.
-
|
The container is running on the same docker network as gotify. Here is a string from my workflow that notifies of workflow completion. Still digging into it. curl "http://192.168.0.228:3003/message?token=privacyEnabled" -F "title=mxprod01 Host Unavailable" -F "message=Deployment skipped due to host unavailability" -F "priority=5" |
Beta Was this translation helpful? Give feedback.
-
|
Need to get more working examples. This is awesome. The Reporting feature, network throughput, and docker container status would be next to hammer out examples of. |
Beta Was this translation helpful? Give feedback.
-
|
`[log] [report] [[report.events]] [[actions]] [[checks]] [[checks.alarms]] [[checks.alarms]] [[actions]] [[actions]] [[checks]] [[checks.alarms]] [[checks.alarms]] [[actions]] [[checks]] [[checks.alarms]] [[checks.alarms]] [[actions]] [[checks]] [[checks.alarms]] [[actions]] |
Beta Was this translation helpful? Give feedback.
So Gotify works using this as an example.
'''[[actions]]
name = "Gotify notification"
type = "Webhook"
url = "http://192.168.0.228:3003/message?token=privacyEnabled"
headers = {"Content-Type" = "application/json"}
body = """{"message": "check '{{check_name}}' changed state to '{{alarm_state}}'", "priority": 2, "title": "Alarm '{{alarm_name}}', id '{{check_id}}'"}"""
'''