インストール
sudo su –
wget https://repos.influxdata.com/ubuntu/pool/stable/t/telegraf/telegraf_1.10.0-1_amd64.deb
apt install ./telegraf_1.10.0-1_amd64.deb
cd /etc/telegraf/
systemctl status telegraf.service
systemctl stop telegraf.service
systemctl status telegraf.service
設定
cp telegraf.conf telegraf.conf.org
vi telegraf.conf
root@ip-172-27-1-160:/etc/telegraf# diff telegraf.conf telegraf.conf.org
93c93
< urls = [“http://172.27.1.160:8086”]
—
> # urls = [“http://127.0.0.1:8086”]
97c97
< database = “telegraf”
—
> # database = “telegraf”
120,121c120,121
< username = “admin”
< password = “admin”
—
> # username = “telegraf”
> # password = “metricsmetricsmetricsmetrics”
355c355
< [[outputs.cloudwatch]]
—
> # [[outputs.cloudwatch]]
357c357
< region = “ap-northeast-1”
—
> # region = “us-east-1”
367,368c367,368
< access_key = “AKIAIKOWXIHZEG7TRSFQ”
< secret_key = “DiMIBgh8DjuuBqiXdR9suZJP5Yp+LxY1GjcDCXeJ”
—
> # #access_key = “”
> # #secret_key = “”
381c381
< namespace = “InfluxData/td-docker”
—
> # namespace = “InfluxData/Telegraf”
1921c1921
< [[inputs.docker]]
—
> # [[inputs.docker]]
1925c1925
< endpoint = “unix:///var/run/docker.sock”
—
> # endpoint = “unix:///var/run/docker.sock”
1931,1932c1931
< # container_names = [“landuse_landuse_db_1″,”map_zenrin_map_zenrin_mongo_1″,”landuse_landuse_app_1″,”landuse_landuse_app_2″,”map_zenrin_map_zenrin_app_1″,”map_zenrin_map_zenrin_app_2″,”map_zenrin_map_zenrin_app_3″,”map_zenrin_map_zenrin_app_4″,”map_zenrin_map_zenrin_app_5″,”map_zenrin_map_zenrin_app_6″,”map_zenrin_map_zenrin_app_7″,”map_zenrin_map_zenrin_app_8″,”map_zenrin_map_zenrin_app_9″,”map_zenrin_map_zenrin_app_10″,”map_zenrin_map_zenrin_app_11″,”map_zenrin_map_zenrin_app_12″,”map_zenrin_map_zenrin_app_13″,”map_zenrin_map_zenrin_app_14″,”map_zenrin_map_zenrin_app_15″,”map_zenrin_map_zenrin_app_16″,”map_zenrin_map_zenrin_app_17″,”map_zenrin_map_zenrin_app_18″,”map_zenrin_map_zenrin_app_19″,”map_zenrin_map_zenrin_app_20”]
< container_names = [“landuse_landuse_db_1″,”map_zenrin_map_zenrin_mongo_1″,”landuse_landuse_app_1″,”landuse_landuse_app_2″,”map_zenrin_map_zenrin_app_1″,”map_zenrin_map_zenrin_app_2”]
—
> # container_names = []
/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d &