Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix freebsd and darwin build
Browse files Browse the repository at this point in the history
gosigar is not supported on these platforms.
We just add metric stubs for now.

Fixes #340
mpfz0r committed Aug 14, 2019

Verified

This commit was signed with the committer’s verified signature.
1 parent 0b6e6e7 commit 7ac39b6
Showing 4 changed files with 60 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -79,11 +79,11 @@ build-linux32: ## Build sidecar binary for Linux 32bit

build-darwin: ## Build sidecar binary for OSX
@mkdir -p build/$(COLLECTOR_VERSION)/darwin/amd64
GOOS=darwin GOARCH=amd64 $(GO) build $(BUILD_OPTS) -v -i -o build/$(COLLECTOR_VERSION)/darwin/amd64/graylog-sidecar
GOOS=darwin GOARCH=amd64 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_darwin -v -i -o build/$(COLLECTOR_VERSION)/darwin/amd64/graylog-sidecar

build-freebsd:
@mkdir -p build/$(COLLECTOR_VERSION)/freebsd/amd64
GOOS=freebsd GOARCH=amd64 $(GO) build $(BUILD_OPTS) -v -i -o build/$(COLLECTOR_VERSION)/freebsd/amd64/graylog-sidecar
GOOS=freebsd GOARCH=amd64 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_freebsd -v -i -o build/$(COLLECTOR_VERSION)/freebsd/amd64/graylog-sidecar

build-windows: ## Build sidecar binary for Windows
@mkdir -p build/$(COLLECTOR_VERSION)/windows/amd64
2 changes: 2 additions & 0 deletions common/sigar.go
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@
// You should have received a copy of the GNU General Public License
// along with Graylog. If not, see <http://www.gnu.org/licenses/>.

// +build !freebsd,!darwin

package common

import (
28 changes: 28 additions & 0 deletions common/sigar_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// This file is part of Graylog.
//
// Graylog is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Graylog is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Graylog. If not, see <http://www.gnu.org/licenses/>.

package common

func GetCpuIdle() float64 {
return -1
}

func GetFileSystemList75() []string {
return []string{}
}

func GetLoad1() float64 {
return -1
}
28 changes: 28 additions & 0 deletions common/sigar_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// This file is part of Graylog.
//
// Graylog is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Graylog is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Graylog. If not, see <http://www.gnu.org/licenses/>.

package common

func GetCpuIdle() float64 {
return -1
}

func GetFileSystemList75() []string {
return []string{}
}

func GetLoad1() float64 {
return -1
}

0 comments on commit 7ac39b6

Please sign in to comment.