2018年5月18日 星期五

Compile Telegraf on Windows 7



Install

Install https://dl.google.com/go/go1.10.2.windows-amd64.msi
Install Git-2.17.1.2-64-bit.exe (for go get)
Install make-3.81.exe (for make Telegraf)
Add C:\Program Files (x86)\GnuWin32\bin to PATH


C:\Users\User\go>go version
go version go1.10.2 windows/amd64

C:\Users\User\go>echo %GOPATH%
C:\Users\User\go

go get -u github.com/golang/lint/golint
go get github.com/sparrc/gdm
go get -d github.com/influxdata/telegraf

gdm restore --parallel=true copy C:\Users\User\go\src\github.com\influxdata\telegraf\Godeps to C:\Users\User\go\Godeps
gdm restore --parallel=true

cd %GOPATH%/src/github.com/influxdata/telegraf
make


C:\Users\User\go\src\github.com\influxdata\telegraf


Input Plugin

cd /home/ricky/go/src/github.com/influxdata/telegraf/plugins/inputs
grep -nr "Start(acc telegraf.Accumulator)"

It shows below plugins use Start()

amqp_consumer
cassandra
http_listener
jti_openconfig_telemetry
kafka_consumer
kafka_consumer_legacy
logparser
mqtt_consumer
nats_consumer
nsq_consumer
socket_listener
tail
tcp_listener
udp_listener
webhooks
zipkin

Plugin

input.go

type Input interface {

SampleConfig() string

Description() string

Gather(Accumulator) error

}


Add Input Plugin

telegraf/plugins/inputs/all/all.go
_ "github.com/influxdata/telegraf/plugins/inputs/sin"

沒有留言:

張貼留言

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...