Skip to content

Instantly share code, notes, and snippets.


Aliaksandr Kazlou zshamrock

Block or report user

Report or block zshamrock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
#!/usr/bin/env bash
View telegraf-output-plugins-conf.snippet
## 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 = “”
View telegraf-input-plugins-conf.snippet
servers = [“mongodb://<username>:<password>”]
url = “https://<node>”
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”]
zshamrock / docker-compose.yml
Last active Mar 20, 2017
TICK services docker compose
View docker-compose.yml
version: '2'
# create a network to share between TICK services, so they can connect to each other by specifying influxdb network name
image: telegraf:1.1.2
container_name: telegraf1.1.2
View kapacitor-cli-show-task
root@kapacitor:~# kapacitor show cpu_alert
ID: cpu_alert
Type: stream
Status: enabled
Executing: true
Created: 02 Dec 16 07:15 UTC
Modified: 02 Dec 16 07:16 UTC
zshamrock / kapacitor-cli-walkthrough
Created Dec 2, 2016
Define and enable Kapacitor task
View kapacitor-cli-walkthrough
root@kapacitor:~# kapacitor define cpu_alert -type stream -tick scripts/cpu_alert.tick -dbrp telegraf.autogen
root@kapacitor:~# kapacitor enable cpu_alert
#!/usr/bin/env bash
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
zshamrock / kapacitor-conf.snippet
Created Dec 2, 2016
Configure Slack integration for Kapacitor
View kapacitor-conf.snippet
enabled = true
  url = “<integration point>”
  channel = “#influx-alerts”
  username = “kapacitor”
  icon-emoji = “”
  global = false
  state-changes-only = false
zshamrock / cpu_alert.tick
Last active Dec 16, 2016
CPU Alert TICK script
View cpu_alert.tick
// Select just the cpu measurement from our example database.
.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.
zshamrock / influxdb-cli-walkthrough
Last active Dec 2, 2016
InfluxDB CLI Walk Through
View influxdb-cli-walkthrough
##### connect
$ ./
Connected to http://localhost:8086 version 1.1.0
InfluxDB shell version: 1.1.0
##### help
> help
 connect <host:port> connects to another node specified by host:port
You can’t perform that action at this time.