-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add email notification, plugins refactoring
- Loading branch information
Showing
12 changed files
with
534 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea/** | ||
build | ||
.goxc.local.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ It’s tool for controlling processes like a supervisord but with some important | |
* Supports gracefull and fast shutdown by signals | ||
* Developed for used inside Docker containers | ||
* Different strategies for processes | ||
* Support template-based email notification | ||
|
||
## Installing | ||
|
||
|
@@ -30,3 +31,61 @@ go get -v -u github.com/reddec/monexec/... | |
Usage: [https://reddec.github.io/monexec/](https://reddec.github.io/monexec/) | ||
|
||
API: [Godoc](http://godoc.org/github.com/reddec/monexec/monexec) | ||
|
||
|
||
## Examples | ||
|
||
See documentation for details [https://reddec.github.io/monexec/](https://reddec.github.io/monexec/) | ||
|
||
### Run from cmd | ||
|
||
```bash | ||
monexec run -l srv1 --consul -- nc -l 9000 | ||
``` | ||
|
||
### Run from config | ||
|
||
```bash | ||
monexec start ./myservice.yaml | ||
``` | ||
|
||
### Notifications | ||
|
||
Add notification to Telegram | ||
|
||
```yaml | ||
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 | ||
```yaml | ||
email: | ||
services: | ||
- myservice | ||
smtp: "smtp.gmail.com:587" | ||
from: "[email protected]" | ||
password: "xyzzzyyyzyyzyz" | ||
to: | ||
- "[email protected]" | ||
template: | | ||
Subject: {{.label}} | ||
Service {{.label}} {{.action}} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.