From d67313e2afcfaf2ea7332b97264dc9499ece5ab2 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sat, 26 May 2018 20:37:56 +0300 Subject: [PATCH] docs++ --- HOOKS.md | 15 +++++++++------ README.md | 20 +++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/HOOKS.md b/HOOKS.md index 10d0e80..b37756f 100644 --- a/HOOKS.md +++ b/HOOKS.md @@ -5,10 +5,10 @@ It's possible to get notifications about new anomalies via [WebHooks](https://en You need to set variable `HASTIC_ALERT_ENDPOINT` with your endpoint and expects `POST` methods from hastic-server if format: -``` +```json { - anomaly: 'cpu_load', - status: + "anomaly": "cpu_load", + "status": "OK" } ``` @@ -26,9 +26,12 @@ docker run -d --name hastic-server -p 80:8000 -e HASTIC_API_KEY= +export HASTIC_PORT= +export HASTIC_ALERT_ENDPOINT=http://alert.example.com + +cd hastic-server/server +npm start ``` diff --git a/README.md b/README.md index 404e880..48e1fc7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Implementation of basic pattern recognition and unsupervised learning for anomaly detection. -Implementation of analytic unit for Hastic. +Implementation of analytic unit for Hastic. See also: * [Hooks](https://github.com/hastic/hastic-server/blob/master/HOOKS.md) - notifications about events @@ -18,8 +18,15 @@ API key role needs only `Viewer` access. Example of running hastic-server in Docker: +#### Build ```bash +git clone https://github.com/hastic/hastic-server.git +cd hastic-server docker build -t hastic-server . +``` + +#### Run +```bash docker run -d --name hastic-server -p 80:8000 -e HASTIC_API_KEY= hastic-server ``` @@ -35,10 +42,10 @@ You can export following environment variables for hastic-server to use: You need in your system: * [nodejs >= 6.0.0](https://nodejs.org/en/download/package-manager/) -* [python3 python3-pip](https://www.python.org/downloads/) +* [python3](https://www.python.org/downloads/) with pip3 * curl gnupg git make g++ -### Intallation +#### Intallation ```bash pip3 install pandas seglearn scipy tsfresh @@ -46,13 +53,12 @@ git clone https://github.com/hastic/hastic-server.git cd ./hastic-server/server npm install npm run build - ``` -### Run +#### Run ```bash -$ export HASTIC_API_KEY= -$ export HASTIC_PORT= +export HASTIC_API_KEY= +export HASTIC_PORT= cd ./hastic-server/server npm start