updog/docs/README.md

65 lines
2.5 KiB
Markdown
Raw Normal View History

# Docs
Welcome to the docs. Not docks, [no docker yet](#docker).
## Usage
### Extensions
First, find some extensions. You'll need a checker to check whether something is up, a logging extension to log stuff, and optionally an extension to send alerts. Extensions are specified on a per-service basis, so you can mix-and-match extensions as much as you want. Once there are some real extensions I'll list some here.
### Config
Then create a `services.json` file for your config, like this:
```json
{
"site": {
"name": "A Website",
"checker": "CheckerTemplate",
"checker-args": {
"url": "https://example.net",
"port": 443,
"lol": "CheckerTemplate ignores these options lol"
},
"rate": 1,
"alerts": "AlertsTemplate",
"alerts-args": {
"url": "https://example.com/webhook-url-or-whatever-goes-here",
"lol": "irrelevant, AlertsTemplate ignores these options lol"
},
"logging": "LoggingTemplate",
"logging-args": {
"file": "/home/askiiart/Documents/updog/logs/site-log"
}
}
}
```
Required arguments:
- The key (in this case `site`): A unique string to identify the service in logs, also used internally.
- `checker`: The name of the checker extension's *class*.
- `checker-args`: Arguments for the checker. Check the checker's docs for what to put here.
- `rate`: How often to check if the service is up (every *x* seconds)
- `alerts`: The name of the alerting extension's *class*.
- `alerts-args`: Arguments for the alerting extension. Check the alerter's docs for what to put here.
- `logging`: The name of the logging extension's *class*.
- `logging-args`: Arguments for the logging extension. Check the logger's docs for what to put here.
Optional arguments:
- `name`: A human-friendly name for the service; currently unused.
---
This example uses the template extensions, [askiiart/updog-checker_template](https://git.askiiart.net/askiiart/updog-checker_template), [askiiart/updog-logging_template](https://git.askiiart.net/askiiart/updog-logging_template), and [askiiart/updog-alerts_template](https://git.askiiart.net/askiiart/updog-alerts_template), so the arguments for them are mostly irrelevant. For each extension, check its docs for what arguments to use.
### Running it
Just run it with `python3 updog.py`
### Docker
No Docker yet, Updog throws `RuntimeError: can't create new thread at interpreter shutdown` when I try to run it in Docker. So no Docker until I figure that out.