Telegraf 설치 및 실행

rodusik·2022년 7월 27일
0

telegraf

목록 보기
1/1

Telegraf는 서버 기반 agent로 데이터베이스, 시스템 및 IoT 센서에서 메트릭 및 이벤트를 수집/전송할 수 있는 오픈소스이다.

최근 centOS 서버의 메트릭을 수집하는 용도로 적용했는데, 설치 및 설정이 매우 간단하며 telegraf에서 다양한 플러그인을 제공하고 있다.


1. Telegraf 설치


설치는 https://portal.influxdata.com/downloads/를 참고한다.
docker image부터 각 패키지 설치 및 바이너리 설치 가이드가 나와있다.

  • yum 설치
$ sudo yum install -y telegraf

2. Telegraf 설정 및 실행

telegraf.conf에 수집할 메트릭과 전송할 플러그인 등을 설정하고 실행하면 된다.
플러그인 적용은 https://docs.influxdata.com/telegraf/v1.23/plugins/ 를 참고하면 된다.

  • 전송할 url 및 header 등을 설정
[[outputs.http]]
    url = "http://127.0.0.1:8080/telegraf"
    timeout = "5s"
    method = "POST"
    data_format = "json"

    [outputs.http.headers]
      Content-Type = "application/json"
  • Telegraf 실행
$ telegraf --config telegraf.conf

0개의 댓글