Telegraf Configuration

Configuration Official Guides

General Guide

Guide details by Plugins

[중요] 주의 사항

CloudHub에서 Addon으로 지원하는 Cloud Service의 Instance 내부에서 동작하는 telegraf 설정은 반드시 [global_tags]csp를 기입하여야, CloudHub UI의 Infrastructure > Host > AWS 등의 Addon관련 리스트에 정상 출력 됩니다.

미리 정의된 csp 코드는 다음과 같습니다.

Cloud Service Provider

Key

Cloud Service Provider

Key

AWS

[global_tags] csp = "aws"

GCP

[global_tags] csp = "gcp"

Config Templates

Common(공통)

Log Handling

  • 아래 내용 중 logtarget은 The Twelve-Factor App > Logs 의 패턴을 준수하기 위해 설정하지 않았습니다.
    해당 로그는 stderr로 출력 되며,

  • Linux의 경우, /var/log/messages에 통합 기록됩니다.

  • Windows의 경우 eventlog로 설정하며, Windows Event Viewer tool을 통해 열람 할 수 있습니다.

참고 logtarget: Log target controls the destination for logs and can be one of "file", "stderr" or, on Windows, "eventlog". When set to "file", the output file is determined by the "logfile" setting.

 

기본 설정 Template

아래는 CloudHub의 설치가 완료되면 기본적인 서버 모니터링을 위한 수집을 위한 기본 설정 템플릿 입니다.

Collector Sever

Salt Master + Salt Minion + Salt API Service 설치된 경우

# global_tags는 구분이 필요한 경우 기입 [global_tags] svc_type = "ch-mgmt" dc = "" rack = "" [agent] interval = "10s" round_interval = true metric_batch_size = 1_000 metric_buffer_limit = 10_000 collection_jitter = "0s" flush_interval = "10s" flush_jitter = "10s" precision = "" hostname = "" # if empty, this is assigned by OS hostname. omit_hostname = false [[outputs.influxdb]] urls = [ "http://{influxdb_url}:8086" ] database = "Default" retention_policy = "" write_consistency = "any" username = "" password = "" [[inputs.cpu]] percpu = false totalcpu = true collect_cpu_time = false report_active = false [[inputs.disk]] ignore_fs = [ "tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs" ] [[inputs.diskio]] [[inputs.kernel]] [[inputs.mem]] [[inputs.net]] [[inputs.processes]] [[inputs.procstat]] systemd_unit = "snet-salt-master" [[inputs.procstat]] systemd_unit = "snet-salt-api" [[inputs.procstat]] systemd_unit = "snet-salt-minion" [[inputs.procstat]] systemd_unit = "telegraf" [[inputs.swap]] [[inputs.system]] [[inputs.netstat]] [[inputs.influxdb]] urls = [ "http://{influxdb_url}:8086/debug/vars" ] [[inputs.kapacitor]] urls = [ "http://{kapacitor_url}:9094/kapacitor/v1/debug/vars" ] timeout = "5s" [[inputs.prometheus]] urls = [ "http://{etcd_url}:2382/metrics" ] metric_version = 2

Collector Agent

Telegraf config advanced sample on Linux (CloudHub Server)

Full Attributes sample: https://github.com/snetsystems/telegraf/blob/release-1.19-snet/etc/telegraf.conf

Telegraf config advanced sample on Windows

Full Attributes Template: https://github.com/snetsystems/telegraf/blob/release-1.19-snet/etc/telegraf_windows.conf