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',