Light supervisor on Go (with optional Consul autoregistration)
MONitoring EXEcutables
It’s tool for controlling processes like a supervisord but with some important features:
Precompilled binaries: release page
From source (required Go toolchain):
go get -v -u github.com/reddec/monexec/...
recommended way is snap
Usage: https://reddec.github.io/monexec/
API: Godoc
See documentation for details https://reddec.github.io/monexec/
monexec run -l srv1 --consul -- nc -l 9000
monexec start ./myservice.yaml
Add notification to Telegram
telegram:
# BOT token
token: "123456789:AAAAAAAAAAAAAAAAAAAAAA_BBBBBBBBBBBB"
services:
# services that will be monitored
- "listener2"
recipients:
# List of telegrams chat id
- 123456789
template: |
*{{.label}}*
Service {{.label}} {{.action}}
{{if .error}}⚠️ *Error:* {{.error}}{{end}}
_time: {{.time}}_
_host: {{.hostname}}_
Add email notification
email:
services:
- myservice
smtp: "smtp.gmail.com:587"
from: "[email protected]"
password: "xyzzzyyyzyyzyz"
to:
- "[email protected]"
template: |
Subject: {{.label}}
Service {{.label}} {{.action}}
Add HTTP request as notification
http:
services:
- myservice
url: "http://example.com/{{.label}}/{{.action}}"
templateFile: "./body.txt"