|
4 years ago | |
---|---|---|
amclient | 4 years ago | |
cmd | 4 years ago | |
systemd | 4 years ago | |
templates | 4 years ago | |
.gitignore | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
actions.go | 4 years ago | |
background.go | 4 years ago | |
crypto.go | 4 years ago | |
db.go | 4 years ago | |
db_test.go | 4 years ago | |
main.go | 4 years ago | |
migration.go | 4 years ago | |
report-handler.go | 4 years ago | |
tmpl_gen.go | 4 years ago | |
types.go | 4 years ago | |
user-handlers.go | 4 years ago | |
validation.go | 4 years ago |
Simple alerts and monitoring server.
The server (cmd/amserver
) compiles to a dependency-free binary. Associated
files will be created or read from the working directory.
The server will call two scripts for log or alert events. These scripts need to
be executable and exist in the working directory. They need to be called
log-action
and alert-action
. They are called with two arguments:
Run the server with a listen address:
amserver -listen example.com:443
If the port is 443, then the server will serve over https and automatically acquire a certificate from letsencrypt.
By default, an account is created with username root
and password root1234
.
Sources can perform three actions: ping
, log
, or alert
. Actions are sent
as standard HTTP POST requests to the URL
https://example.com/report/<APIKey>
.
For example:
curl \
--data-urlencode "action=alert" \
--data-urlencode "text=An alert!" \
https://example.com/report/$API_KEY