-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
548779a
commit 2ebd582
Showing
5 changed files
with
59 additions
and
16 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/ | ||
/config.yml | ||
/config.yml | ||
/notdeadyet |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM golang:1.18-alpine AS base | ||
WORKDIR /app | ||
|
||
FROM base AS build | ||
COPY . . | ||
RUN go build -v -o notdeadyet | ||
|
||
FROM base AS final | ||
COPY --from=build /app/notdeadyet . | ||
EXPOSE 80 | ||
CMD [ "/app/notdeadyet", "--config-file=/config/config.yml" ] |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# notdeadyet | ||
|
||
This is a simple dead man's switch monitoring daemon written in Go. It watches, if an API endpoint is polled at a regular, configurable interval, and triggers an alarm otherwise. | ||
|
||
For now, only **Pushover** receivers are supported, but more can be added easily. | ||
|
||
## Usage | ||
|
||
### Configuration file | ||
|
||
Take a look at the following sample to write your own `config.yml`: | ||
|
||
```yaml | ||
listen: ':80' # Optional | ||
apps: | ||
- name: Test App | ||
token: djms90x1hqflyggx # Generate a random token yourself | ||
timeout: 1h | ||
repeat_interval: 1h | ||
notify: | ||
- Super Administrator | ||
receivers: | ||
pushover: | ||
- name: Super Administrator | ||
user_key: ... | ||
token: ... | ||
priority: 0 | ||
``` | ||
### Run | ||
You can then run the daemon with | ||
``` | ||
./notdeadyet --config-file=config.yml | ||
``` | ||
|
||
or use the provided Docker images and mount your config into `/config/config.yml`. | ||
|
||
### Making requests | ||
|
||
You should configure your monitored applications to make regular `GET` or `POST` requests against `http://SERVER/im-alive/TOKEN` to tell `notdeadyet` that the app is still alive. | ||
|
||
If the monitored app stops making these requests for the duration configured in `timeout`, then the selected receivers will receive a notification. When the app starts making requests again, a notification is sent, that the app is back. | ||
|
||
**Have fun!** |
This file was deleted.
Oops, something went wrong.
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