Telegraf on MacOS: make succeeds, but run fails with "killed: 9"

I’m trying to build telegraf locally on a Mac to create a new plugin. I’m starting with a blank slate and want to just build a clean image first. I followed the instructions here: GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics. (under the heading “From Source”) and it made a telegraf executable file. Good so far.

When I try to execute the file i.e.: ./telegraf --help or ./telegraf --version …

It fails with the message: “Killed: 9”

Has anyone encountered this before? Is there a way to build this on a mac?

Notes:

  1. go is setup and working fine.
  2. make seems to work fine.
  3. I’m using “go get -d GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.” as the base

We had a similar issue reported some time ago on the issue tracker, it was an issue with CGO and was resolved by updating the Go version:

This is an issue with the version of Go that I was using. This happens with Go 1.8 on MacOS 10.10 or higher. More details can be found here: runtime: some Go executables broken with macOS 10.12.4 / Xcode 8.3 but fine with Xcode 8.2 · Issue #19734 · golang/go · GitHub

An update of Go v1.10 resolved the issue.