forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fd27ba
commit 1da6b70
Showing
17 changed files
with
482 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,8 +146,8 @@ stream | |
.period(10s) | ||
.every(5s) | ||
.mapReduce(influxql.mean("value")) | ||
.where("value < 30") | ||
.alert() | ||
.crit("value < 30") | ||
.email("[email protected]"); | ||
``` | ||
|
||
|
@@ -182,8 +182,8 @@ stream | |
.every(5s) | ||
.groupBy("dc") | ||
.mapReduce(influxql.mean("value")) | ||
.where("value < 30") | ||
.alert() | ||
.crit("value < 30") | ||
.email("[email protected]"); | ||
``` | ||
|
||
|
@@ -244,8 +244,8 @@ batch | |
.period(15m) | ||
// or .cron("*/15 * * * 0") | ||
.groupBy(time(1h), "dc") | ||
.where("value < 30") | ||
.alert() | ||
.crit("value < 30") | ||
.email("[email protected]"); | ||
``` | ||
|
||
|
@@ -285,7 +285,9 @@ stream | |
.period(1m) | ||
.every(1m) | ||
.mapReduce(influxql.count("value")) | ||
.alert(); | ||
.alert() | ||
.crit("true") | ||
.email("[email protected]"); | ||
|
||
//Now define normal processing on the stream | ||
stream | ||
|
@@ -299,7 +301,9 @@ stream | |
.window() | ||
... | ||
.alert() | ||
.flapping(25.0, 50.0); | ||
.crit("true") | ||
.flapping(25.0, 50.0) | ||
.email("[email protected]"); | ||
``` | ||
#### Aggregate alerts | ||
|
@@ -317,13 +321,17 @@ var redis = stream | |
.from("redis") | ||
.where("instantaneous_ops_per_sec < 10") | ||
.groupBy("host") | ||
.alert(); | ||
.alert() | ||
.crit("true") | ||
.email("[email protected]"); | ||
var cpu = stream | ||
.from("cpu") | ||
.where("idle < 20") | ||
.groupBy("host") | ||
.alert(); | ||
.alert() | ||
.crit("true") | ||
.email("[email protected]"); | ||
``` | ||
Now lets say we want to combine the alerts so that if a either alert triggers we can send them in the same alert. | ||
|
@@ -342,7 +350,9 @@ redis.union(cpu) | |
.window() | ||
.period(10s) | ||
.every(10s) | ||
.alert(); | ||
.alert() | ||
.crit("true") | ||
.email("[email protected]"); | ||
``` | ||
This will aggregate the union of all alerts every 10s by host. Then it will send out one alert with the aggregate information. | ||
|
@@ -399,7 +409,7 @@ stream | |
.every(1s) | ||
.map(fMap, "idle") | ||
.reduce(fReduce) | ||
.cache(); | ||
.httpOut("http://example.com/path"); | ||
``` | ||
The `mapFunction.py` and `reduceFunction.py` files contain python scripts that read data on an incoming stream perform their function and output the result. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.