This repository has been archived on 2019-06-27. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
Go to file
J. David Lee 49ab7946c7 Souce can only be timed out if timeout is non-zero. 2019-06-27 21:41:05 +02:00
amclient Client to log if URL is empty. 2019-06-11 20:07:43 +02:00
cmd am command line client: fixed bug 2019-06-11 06:36:36 +02:00
systemd Systemd file 2019-06-11 08:25:25 +02:00
templates Code cleanup, template updates. 2019-06-11 15:47:46 +02:00
.gitignore Initial commit 2019-06-10 18:50:22 +02:00
LICENSE Update 'LICENSE' 2019-06-10 18:51:11 +02:00
README.md Code cleanup 2019-06-11 14:06:37 +02:00
actions.go Code cleanup 2019-06-11 09:44:35 +02:00
background.go Code cleanup 2019-06-11 09:44:35 +02:00
crypto.go Initial commit. 2019-06-10 19:09:10 +02:00
db.go Code cleanup 2019-06-11 14:04:59 +02:00
db_test.go Initial commit. 2019-06-10 19:09:10 +02:00
main.go Code cleanup, template updates. 2019-06-11 15:47:46 +02:00
migration.go Code cleanup 2019-06-11 09:44:35 +02:00
report-handler.go Code cleanup 2019-06-11 09:44:35 +02:00
tmpl_gen.go Code cleanup, template updates. 2019-06-11 15:47:46 +02:00
types.go Souce can only be timed out if timeout is non-zero. 2019-06-27 21:41:05 +02:00
user-handlers.go Code cleanup 2019-06-11 14:04:59 +02:00
validation.go Initial commit. 2019-06-10 19:09:10 +02:00

README.md

am

Simple alerts and monitoring server.

Server Installation

The server (cmd/amserver) compiles to a dependency-free binary. Associated files will be created or read from the working directory.

Log and Alert Scripts

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:

  1. The name of the source reporting the log or alert.
  2. The associated text.

Running

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.

Default User Account

By default, an account is created with username root and password root1234.

Source Usage

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