Kapacitor
설치
- OS별 설치가이드
- Ubuntu 16.04 환경하 설치
$ wget https://dl.influxdata.com/kapacitor/releases/kapacitor_1.2.0_amd64.deb $ sudo dpkg -i kapacitor_1.2.0_amd64.deb
- 실행:
$ service kapacitor start $ service kapacitor stop
설정
- 설정파일: /etc/kapacitor/kapacitor.conf
- influxdb 에 대한 설정
[[influxdb]] # Connect to an InfluxDB cluster # Kapacitor can subscribe, query and write to this cluster. # Using InfluxDB is not required and can be disabled. enabled = true default = true name = "localhost" urls = ["http://localhost:8086"] username = "" password = "" timeout = 0
스크립트 생성 / 등록 / 관리
- 생성 sample:
$ vi /home/influxdb/kapacitor_script/cpu_alert.tick stream // Select just the cpu measurement from our example database. |from() .measurement('cpu') |alert() .crit(lambda: "usage_idle" < 70) // Whenever we get an alert write it to a file. .log('/tmp/alerts.log')
- 등록:
$ kapacitor define "cpu_alert" -type "stream" -tick /home/influxdb/kapacitor_script/cpu_alert.tick -dbrp telegraf.default
- type 은 stream 과 batch
- dbrp 는 database . retention policy
- tick 은 사용하는 스크립트
- 실행: $ kapacitor record stream -task cpu_alert -duration 20s
- 조회: $ kapacitor list recordings
- 생성 sample:
'Cloud > influxDATA' 카테고리의 다른 글
Telegraf (0) | 2017.03.13 |
---|---|
InfluxData Platform (TICK, Telegraf+InfluxDB+Chronograf+Kapacitor) (0) | 2017.03.10 |
influxdb 란 (0) | 2017.03.08 |