Install
Install https://dl.google.com/go/go1.10.2.windows-amd64.msiInstall 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/inputsgrep -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"
沒有留言:
張貼留言