https://github.com/toni-moreno/resistor
A WebService Based Filter for InfluxData Kapacitor Alerts
https://github.com/toni-moreno/resistor
alert-filtering alerting frontend- golang influxdb kapacitor udf
Last synced: 5 months ago
JSON representation
A WebService Based Filter for InfluxData Kapacitor Alerts
- Host: GitHub
- URL: https://github.com/toni-moreno/resistor
- Owner: toni-moreno
- License: mit
- Created: 2017-10-25T09:15:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-26T04:20:44.000Z (about 7 years ago)
- Last Synced: 2024-06-21T14:17:14.923Z (almost 2 years ago)
- Topics: alert-filtering, alerting, frontend-, golang, influxdb, kapacitor, udf
- Language: TypeScript
- Size: 3.88 MB
- Stars: 10
- Watchers: 8
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Resistor
Resistor is a complement to the InfluxData Kapactor tool https://github.com/influxdata/kapacitor and has 3 functional components.
* Alert filtering system: it acts as alert filter for diferent WebHooks , it can filter by ALERTID's, time and tags, without need to change tasks variables or template definition. It can exclude alerts only on some devices or a group of them based on tags.
* Easy alert management: it can deploy alerts based on basic templates.
* It has and resistor_udf with habilty to inject some tags / fields over datapoints depending on the value for another tag ( by example the deviceid)
If you wish to compile from source code you can follow the next steps
## Run from master
If you want to build a package yourself, or contribute. Here is a guide for how to do that.
### Dependencies
- Go 1.5
- NodeJS >=6.2.1
### Get Code
```bash
go get github.com/toni-moreno/resistor
```
### Building the backend
```bash
cd $GOPATH/src/github.com/toni-moreno/resistor
go run build.go setup (only needed once to install godep)
godep restore (will pull down all golang lib dependencies in your current GOPATH)
```
### Building frontend and backend in production mode
```bash
npm install
PATH=$(npm bin):$PATH
npm run build:pro #will build fronted and backend
```
### Creating minimal package tar.gz
```bash
npm run postbuild #will build fronted and backend
```
### Creating rpm and deb packages
You will need previously installed the fpm/rpm and deb packaging tools
```bash
go run build.go latest
```
### Recompile backend on source change (only for developers)
To rebuild on source change (requires that you executed godep restore)
```bash
go get github.com/Unknwon/bra
npm start
```
will init a change autodetect webserver with angular-cli (ng serve) and also a autodetect and recompile process with bra for the backend
## Running first time
To execute without any configuration you need a minimal config.toml file on the conf directory.
### main resistor tool
```bash
cp conf/sample.resistor.toml conf/resistor.toml
./bin/resistor
```
### resistor Injector
```bash
cp conf/sample.resinjector.toml conf/resinjector.toml
./bin/resinjector
```
### Setup templates.
Resistor alert config are related to the kapacitor templates, So resistor has these enbedded templates, you can generate and also upload to the resistor engine thougth its HTTP API with the generate_templates.sh script, you can setup
```bash
export RESISTOR_URL="http://localhost:6090"
export RESISTOR_USER="mysuperadmin_user"
export RESISTOR_PASS="mysuperadmin_pass"
./templates/generate_templates.sh
```
## First Setup Guide
Now you wil be able to configure metrics/measuremnets and devices from the builting web server at http://localhost:6090 or http://localhost:4200 if working in development mode (npm start)
Resistor depends on InfluxDB and Kapacitor Tools. Be sure you have InfluxDB and Kapacitor Installed.
When first executed , you will want.
1. Add all your InfluxDB instances.
2. Add all your Kapacitor instances. And configure them with the resInjetor UDF, you can do that by adding this config to the [udf .functions] config section at all your /etc/kapacitor/kapacitor.conf files.
```toml
[udf.functions.resInjector]
socket = "/tmp/resInjector.sock"
timeout = "10s"
```
3. Build a product/measurment/fields/tags catalog.(with these 2 steps)
* import all your influx catalog first
* Organize measurements by product and product by product_groups then.
4. Import The base Templates.
When done you will be ready to create basic alerts for all your products.
### Template naming standars
(pending)