The role of each solution
What you'll build
Beautiful system metric monitoring system for own computer(localhost).
What you'll need
* About 10 minutes
* Macbook
Install & setup apps(3min)
1. install telegraf
$ brew install telegraf
2. setup telegraf
$ cd /usr/local/Cellar/telegraf/1.5.1/bin
$ telegraf config > telegraf.conf
$ vi telegraf.conf
###############################################################################
# OUTPUT PLUGINS #
###############################################################################
# Configuration for influxdb server to send metrics to
[[outputs.influxdb]]
## The full HTTP or UDP 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://127.0.0.1:8089"] # UDP endpoint example
urls = ["http://127.0.0.1:8086"] # required
## The target database for metrics (telegraf will create it if not exists).
database = "telegraf" # required
3. install influxdb
$ brew install influxdb
4. install grafana
$ brew install grafana
Start apps(1min)
1. start influxdb
$ ln -sfv /usr/local/opt/influxdb/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.influxdb.plist
2. create database which name is telegraf
$ influx
Connected to http://localhost:8086 version v1.4.2
InfluxDB shell version: v1.4.2
> create database telegraf
> use telegraf
Using database telegraf
3. start grafana
$ brew tap homebrew/services
$ brew services start grafana
4. start telegraf
$ telegraf --config telegraf.conf
Configure dashboard (6min)
User : admin / Password : admin
InfluxDB details / User : admin / Password : admin
If you want to show fields?
$ influx
Connected to http://localhost:8086 version v1.4.2
InfluxDB shell version: v1.4.2
> SHOW FIELD KEYS
name: cpu
---------
fieldKey fieldType
usage_guest float
usage_guest_nice float
usage_idle float
usage_iowait float
usage_irq float
usage_nice float
usage_softirq float
usage_steal float
usage_system float
usage_user float
name: mem
---------
fieldKey fieldType
active integer
available integer
available_percent float
buffered integer
cached integer
free integer
inactive integer
total integer
used integer
used_percent float
CPU usage query
select usage_user from cpu
Memory usage query
available_percent from mem
used_percent from mem
select Stack mode
Done
You can also customize graphs with plugin
End of Documents
반응형
'개발이야기 > open source' 카테고리의 다른 글
[asciinema] shell script, terminal 영상으로 녹화하기!! (954) | 2018.04.17 |
---|---|
[Hazelcast]Java concurrent lock 구현하기 (1823) | 2018.04.08 |
IMDG 소개 및 하젤케스트 오픈소스 솔루션 소개 (1095) | 2018.04.08 |
소나큐브 파라미터 정리 (0) | 2018.02.20 |
[Telegraf + influxDB + Grafana]10분만에 데브옵스를 위한 모니터링 시스템 구축하기 (7) | 2018.01.29 |
[Telegraf + influxDB + Grafana]DevOps를 위한 서버 모니터링 솔루션 선택 (1) | 2018.01.28 |