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
#!/usr/bin/env bash | |
TELEGRAF_VERSION=1.1.2 | |
INFLUXDB_VERSION=1.1.1 | |
CHRONOGRAF_VERSION=1.1.0-beta2 | |
KAPACITOR_VERSION=1.1.1 |
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
[[outputs.influxdb]] | |
## The full HTTP or UDP endpoint URL for your InfluxDB instance. | |
## Multiple urls can be specified as part of the same cluster, | |
## this means that only ONE of the urls will be written to each interval. | |
# urls = [“udp://localhost:8089”] # UDP endpoint example | |
urls = [“http://localhost:8086"] # required | |
## The target database for metrics (telegraf will create it if not exists). | |
database = “telegraf” # required | |
## Retention policy to write to. Empty string writes to the default rp. | |
retention_policy = “” |
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
[[inputs.mongodb]] | |
servers = [“mongodb://<username>:<password>@mongo.dev.picnicinternational.com:27000/dev?authSource=admin”] | |
[[inputs.rabbitmq]] | |
url = “https://<node>.rmq.cloudamqp.com” | |
name = “dev-rabbitmq” # optional tag | |
username = “<username>” | |
password = “<password>” | |
## A list of nodes to pull metrics about. If not specified, metrics for | |
## all nodes are gathered. | |
nodes = [“rabbit@<node>-01”] |
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
version: '2' | |
networks: | |
# create a network to share between TICK services, so they can connect to each other by specifying influxdb network name | |
influxdb: | |
services: | |
telegraf: | |
image: telegraf:1.1.2 | |
container_name: telegraf1.1.2 |
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
./kapacitor-cli.sh | |
root@kapacitor:~# kapacitor show cpu_alert | |
ID: cpu_alert | |
Error: | |
Template: | |
Type: stream | |
Status: enabled | |
Executing: true | |
Created: 02 Dec 16 07:15 UTC | |
Modified: 02 Dec 16 07:16 UTC |
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
./kapacitor-cli.sh | |
root@kapacitor:~# kapacitor define cpu_alert -type stream -tick scripts/cpu_alert.tick -dbrp telegraf.autogen | |
root@kapacitor:~# kapacitor enable cpu_alert |
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
#!/usr/bin/env bash | |
. versions.sh | |
docker run --rm --net=container:kapacitor${KAPACITOR_VERSION} \ | |
-v $PWD/cli/kapacitor:/root -w=/root -it \ | |
-v $PWD/cli/kapacitor/logs:/var/log \ | |
kapacitor:${KAPACITOR_VERSION} bash -l |
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
[slack] | |
enabled = true | |
url = “https://hooks.slack.com/services/<integration point>” | |
channel = “#influx-alerts” | |
username = “kapacitor” | |
icon-emoji = “” | |
global = false | |
state-changes-only = false |
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
stream | |
// Select just the cpu measurement from our example database. | |
|from() | |
.measurement('cpu') | |
|alert() | |
.message('{{ .Level }}: CPU idle usage is above 80% threshold @ {{ index .Tags "host" }}') | |
.crit(lambda: "usage_idle" > 80) | |
// Whenever we get an alert write it to a file. | |
.log('/var/log/alerts.log') | |
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
##### connect | |
$ ./influxdb-cli.sh | |
Connected to http://localhost:8086 version 1.1.0 | |
InfluxDB shell version: 1.1.0 | |
> | |
##### help | |
> help | |
Usage: | |
connect <host:port> connects to another node specified by host:port |
NewerOlder