Compiling and Running Sensu Go on ARM

How to compile and run Sensu Go on arm boards


When I originally wrote this post, I was operating under some outdated assumptions when it comes to building Sensu on arm devices. I’ll post the updates here at the beginning of the article, and you can read on to see how I’d previously set up Sensu on my Nvidia Jetson Nanos.

Compiling Sensu Go

As a Go novice, I didn’t fully understand the workflow for compiling Sensu for arm devices. As it so happens, it’s fairly easy to cross-compile from whatever device you’re on and then just transfer the binaries to the system you want to run on. I found this out the hard way by trying to compile on the Raspberry Pi’s I have. This resulted in them locking up.

So let’s walk through the non-build-script way of doing this:

  1. Install Go
  2. Obtain Sensu Go
  3. Build the binary for your arm system of choice using GOOS=linux GOARCH=arm go install ./... from inside the project root ($GOPATH/src/github/sensu/sensu-go)
  4. Transfer to the binary/binaries to your Pi’s, Nano’s, or other arm board
  5. Proceed through the rest of the setup

Now, you can absolutely run through the original post as it was and still run Sensu. However, I find that cross compiling from a system with a bit more oomph is going to make things easier.

Original post

In this post, I’ll cover how I am running Sensu Go on several NVIDIA Jetson Nanos. Though this is being done on a Nano, you could use the same approach I use here on a Raspberry Pi, or any other armv7 board. I would note that this is a temporary until official Sensu Go arm packages are released.

The Setup

There are several things you’ll need to do before you can start playing around with Sensu Go.

  1. Install Go on your system
  2. Grab Sensu Go
  3. Build the binaries

Installing Go

While installing Go on the Jetson as fairly trivial, the goal here is to give you a complete accounting of how I did what I did.

To install Go, run:

sudo apt-get install golang

You should then have it installed on your system. If you need more complete documentation on installing Go, please see Go’s docs on downloading and installing Go onto your system.

Obtaining Sensu Go

Once you’ve installed Go, the next step is to obtain Sensu Go. To get the package, run the following:

go get

This will put the package at $GOPATH/src/

Building the Binaries

Next up, we’re going to build the binaries using a script provided in the repo. You’ll want to ensure that you’re in $GOPATH/src/ Once you’re there, you’ll find a script called

❯❯❯❯ ls
agent    dashboard       rpc        vendor           Dockerfile.rhel_atomic  build.ps1
api      docker-scripts  scripts    version          Dockerfile.testagent
asset    examples        system                  docker-compose.yaml
backend  graphql         testing  Gopkg.lock
cli      handler         transport  DCO              Gopkg.toml
cmd      js              types      Dockerfile       LICENSE
command  licenses        util       Dockerfile.rhel

We’ll run that and build our binaries:


Now, we’ll grab that binaries that were built:

cd $GOPATH/bin

sudo cp sensu-{agent,backend} /usr/sbin/

That’s it for the prep work. Now it’s on to actually running Sensu Go.

Running Sensu Go

To run Sensu Go, we’ll need to go through the following steps:

  1. Create the service files for the respective services
  2. Create the Sensu user/group
  3. Create the respective directories needed for Sensu to operate
  4. Grab config files for Sensu Go

Creating the Service Files

There are two service files that will need to be created in order to use systemd to manage Sensu Go as you’d find with RHEL/Debian packages:

Sensu Backend Service File

Description=The Sensu Backend service.

# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
ExecStart=/usr/sbin/sensu-backend start -c /etc/sensu/backend.yml


To make this a bit easier, you can do the following:

sudo curl -L -o /lib/systemd/system/sensu-backend.service

Sensu Agent Service File

Description=The Sensu Agent process.

# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
ExecStart=/usr/sbin/sensu-agent start


And the same with this one:

sudo curl -L -o /lib/systemd/system/sensu-agent.service

Again, these will need to live at /lib/systemd/system/sensu-backend.service and /lib/systemd/system/sensu-agent.service respectively. Once you’ve got those in place, let’s move onto the next step.

Create the Sensu User/Group

This is fairly simple, as we’ll only need to create a service account for Sensu:

sudo useradd -r sensu

Now, onto the next step of creating the requisite directories for Sensu.

Create Sensu Directories

There are three directories that need to be created and owned by the Sensu user:

  • /var/lib/sensu
  • /var/cache/sensu
  • /etc/sensu

Create each of these and change the ownership on them:

sudo /var/lib/sensu
sudo /var/cache/sensu
sudo mkdir /etc/sensu

sudo chown sensu. /var/lib/sensu
sudo chown sensu. /var/cache/sensu
sudo chown sensu. /etc/sensu

Alright, now for the last step: obtaining the config files.

Obtaining Sensu Go Config Files

This is also a fairly quick step:

curl -LO\{agent,backend\}.yml

sudo cp {agent,backend}.yml /etc/sensu

Now, let’s get cooking.

Start Sensu Go

This is it. The moment you’ve been waiting for. It’s time to run Sensu!

sudo systemctl enable sensu-{agent,backend}

sudo systemctl start sensu-{agent,backend}

To ensure that Sensu is running as we expect, do a quick sudo journalctl -fu sensu-backend. Journald should be free of any errors and if you go to http://IPOFYOURSYSTEM:3000, you should get a nice dashboard that looks like:

sensu go dashboard

There you have it! If you want to cluster a few Jetson Nanos, or Raspberry Pis up, head over to Sensu’s clustering guide.