From 4eff8404a773b672ca65e7355717d4c8eff850b6 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 13 Oct 2020 17:26:14 +0100 Subject: [PATCH] Update usage and README.md --- README.md | 19 ++++++++++++++++++- alertify.py | 9 ++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c9db3f..2102a40 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,21 @@ -This application bridges Alertmanager alerts to [Gotify](https://gotify.net). +This application bridges [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/) alerts to [Gotify](https://gotify.net/). + +# Usage +``` +usage: alertify.py [-h] [-H] + +Bridge between Prometheus Alertmanager and Gotify + +optional arguments: + -h, --help show this help message and exit + -H, --healthcheck Simply exit with 0 for healthy or 1 when unhealthy + +Three environment variables are required to be set: + * GOTIFY_SERVER: hostname of the Gotify server + * GOTIFY_PORT: port of the Gotify server + * GOTIFY_KEY: app token for alertify +``` + # Notes * Listens on port 8080 by default. diff --git a/alertify.py b/alertify.py index dd746c8..1d8f97f 100644 --- a/alertify.py +++ b/alertify.py @@ -127,7 +127,14 @@ if __name__ == '__main__': """ Function to parse the CLI """ - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + description='Bridge between Prometheus Alertmanager and Gotify\n', + epilog='Three environment variables are required to be set:\n' + ' * GOTIFY_SERVER: hostname of the Gotify server\n' + ' * GOTIFY_PORT: port of the Gotify server\n' + ' * GOTIFY_KEY: app token for alertify' + ) parser.add_argument( '-H', '--healthcheck',