Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD Support #355

Closed
syepes opened this issue Nov 9, 2015 · 11 comments
Closed

FreeBSD Support #355

syepes opened this issue Nov 9, 2015 · 11 comments

Comments

@syepes
Copy link

syepes commented Nov 9, 2015

It would be great if we could add support for FreeBSD

@sparrc
Copy link
Contributor

sparrc commented Nov 9, 2015

@syepes Do you mean for pre-compiled binaries or a package you could install? Telegraf should compile on FreeBSD, afaik

@syepes
Copy link
Author

syepes commented Nov 10, 2015

I was thinking more that the system/net and zfs plugins be able to collect there info from fBSD.

@sparrc
Copy link
Contributor

sparrc commented Nov 10, 2015

Could you be more specific about what errors you are seeing in those plugins?

@cornerot
Copy link
Contributor

Currently, ZFS plugin does not work on fBSD

@syepes
Copy link
Author

syepes commented Nov 13, 2015

FreeBSD Build log failure:

# gmake
go get github.com/tools/godep
/opt/go/bin/godep go build -o telegraf -ldflags \
        "-X main.Version=v0.2.0-52-g68ef07b" \
        ./cmd/telegraf/telegraf.go
# github.com/cloudfoundry/gosigar
Godeps/_workspace/src/github.com/cloudfoundry/gosigar/concrete_sigar.go:20: cpuUsage.Get undefined (type Cpu has no field or method Get)
Godeps/_workspace/src/github.com/cloudfoundry/gosigar/concrete_sigar.go:30: cpuUsage.Get undefined (type Cpu has no field or method Get)
Godeps/_workspace/src/github.com/cloudfoundry/gosigar/concrete_sigar.go:49: l.Get undefined (type LoadAverage has no field or method Get)
Godeps/_workspace/src/github.com/cloudfoundry/gosigar/concrete_sigar.go:55: m.Get undefined (type Mem has no field or method Get)
Godeps/_workspace/src/github.com/cloudfoundry/gosigar/concrete_sigar.go:61: s.Get undefined (type Swap has no field or method Get)
Godeps/_workspace/src/github.com/cloudfoundry/gosigar/sigar_unix.go:23: cannot use stat.Ffree (type int64) as type uint64 in assignment
# github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_freebsd.go:10: ioctlReadTermios redeclared in this block
        previous declaration at Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_bsd.go:7
Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_freebsd.go:12: Termios redeclared in this block
        previous declaration at Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_bsd.go:9
godep: go exit status 2
Makefile:9: recipe for target 'build' failed
gmake: *** [build] Error 1

# go version
go version go1.5.1 freebsd/amd64

# uname -a
FreeBSD node 10.2-STABLE FreeBSD 10.2-STABLE #11 r289763: Thu Oct 22 23:30:25 CEST 2015 node:/usr/obj/usr/src/sys/GENERIC  amd64

@MerlinDMC
Copy link
Contributor

That is due to the fact that the dependency gosigar has no FreeBSD support.

It is mainly using the proc filesystem to parse cpu stats which in FreeBSD is not available.
You probably want to extend gosigar to support FreeBSD in the first place which would mean getting a sigar_freebsd.go in there that implements the missing bits of all those types - mainly all the Get methods.
If you take sigar_linux.go as a source and reimplement the stat gathering for the FreeBSD world you would be good.

@sparrc
Copy link
Contributor

sparrc commented Nov 15, 2015

I think it would be more simple to just remove the go-sigar dependency and replace it with gopsutil. gosigar is a project that doesn't often respond to PRs, and I think you even have to send in a snail-mail CLA agreement

@MerlinDMC
Copy link
Contributor

@sparrc since gopsutil is already a dependency for other stuff this seems to be a good way.
There still is the termios problem in the logrus code but @sirupsen is very responsive so that problem might be easily solved.

@MerlinDMC
Copy link
Contributor

Turns out it already is fixed in logrus just the stored version of go-dockerclient still had a broken version.
A simple bump of github.com/fsouza/go-dockerclient via godep did the trick.

PR #372 should fix compilation on FreeBSD

@sparrc
Copy link
Contributor

sparrc commented Dec 9, 2015

fixed by #372

@rickard-von-essen
Copy link
Contributor

@syepes @cornerot FYI: Telegraf now support ZFS on FreeBSD since #1224.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants