Testing Nightly Releases

WARNING: Sensu nightly releases are your first chance to try out new features and bug fixes. Please be aware that you may be the first to discover an issue, you probably do not want to use a nightly release in production.

WARNING: Please uninstall/purge any previous Sensu 2.x packages before switching to the nightly repositories.

Testing and using a Sensu nightly release is straightforward, it simply involves using a different package repository. You should only be using nightly releases if you already have experience installing and managing a Sensu installation. Below are the per-platform nightly repository installation instructions. We are slowly adding nightly repositories for other platforms.

NOTE: The Sensu nightly repository instructions replace the existing Sensu repository configuration files, you will need to revert these changes in order to return to using stable releases.

The Sensu 2.0 binaries are statically linked and can be deployed to any Linux or Windows operating system.

Backend

The Sensu Backend (sensu-backend) is a single statically linked binary that can be deployed via packages (.deb or .rpm) or Docker image.

Agent

The Sensu Agent (sensu-agent) is a single statically linked binary that can be deployed via packages (.deb or .rpm) or Docker image.

Installation

Ubuntu/Debian

Add the Sensu nightly repository.

curl -s https://packagecloud.io/install/repositories/sensu/nightly/script.deb.sh | sudo bash

Install the packages from the Sensu nightly repository.

sudo apt-get install sensu-backend sensu-agent

RHEL/CentOS

Add the Sensu nightly repository.

curl -s https://packagecloud.io/install/repositories/sensu/nightly/script.rpm.sh | sudo bash

Install the Sensu backend and agent packages.

sudo yum install sensu-backend sensu-agent

Windows

Coming soon.

Configuration

The example config files list all of the configurable options for each service.

Linux

Sensu Backend

Copy the example backend config file to the default config path.

sudo cp /etc/sensu/backend.yml.example /etc/sensu/backend.yml

The backend config requires state-dir to be set. The example config sets state-dir to /var/lib/sensu by default.

Sensu Agent

Copy the example agent config file to the default config path.

sudo cp /etc/sensu/agent.yml.example /etc/sensu/agent.yml

In order for the agent to function, it will need to have a list of one or more backends to point to. This can be set by setting backend-url to the ip and port of a Sensu backend.

backend-url:
  - "ws://127.0.0.1:8081"

Windows

Coming soon.

Starting the services

Ubuntu 14.04 / CentOS 6 / RHEL 6

Start the services using the sysvinit scripts.

sudo /etc/init.d/sensu-backend start
sudo /etc/init.d/sensu-agent start

Ubuntu 16.04 / CentOS 7 / RHEL 7

Start the services using systemd.

sudo systemctl start sensu-backend
sudo systemctl start sensu-agent

Windows

Coming soon.

Validating the services

Ubuntu 14.04 / CentOS 6 / RHEL 6

Verify that the services are properly running using journalctl.

tail -f /var/log/sensu/sensu-backend.log
tail -f /var/log/sensu-agent.log

Ubuntu 16.04 / CentOS 7 / RHEL 7

Verify that the services are properly running using the log files.

journalctl -u sensu-backend -f
journalctl -u sensu-agent -f

Windows

Coming soon.

Docker

Sensu 2.0 can be run via Docker or rkt using the sensu/sensu image. When running Sensu from Docker there are a couple of things to take into consideration.

The backend requires 3 exposed ports and persistent storage. This example uses a shared filesystem. Sensu 2.0 is backed by a distributed database, and its storage should be provisioned accordingly. We recommend local storage or something like Throughtput Optimized or Provisioned IOPS EBS if local storage is unavailable. The 3 exposed ports are:

  • 2380: Sensu storage peer listener (only other sensu-backends need access to this port)
  • 3000: Sensu dashboard (not yet complete)
  • 8080: Sensu API (all users need access to this port)
  • 8081: Agent API (all agents need access to this port)

We suggest, but do not require, persistent storage for sensu-agents. The Sensu Agent will cache runtime assets locally for each check. This storage should be unique per sensu-agent process.

How To

  1. Start the sensu-backend process

    docker run -v /var/lib/sensu:/var/lib/sensu -d --name sensu-backend -p 2380:2380 \
    -p 3000:3000 -p 8080:8080 -p 8081:8081 sensu/sensu:nightly sensu-backend start

  2. Start an agent In this case, we’re starting an agent whose ID is the hostname with the webserver and system subscriptions. This assumes that sensu-backend is running on another host named sensu.yourdomain.com. If you are running these locally on the same system, be sure to add --link sensu-backend to your Docker arguments and change the backend URL --backend-url ws://sensu-backend:8081.

    docker run -v /var/lib/sensu:/var/lib/sensu -d --name sensu-agent \ 
    sensu/sensu:nightly sensu-agent start --backend-url ws://sensu.yourdomain.com:8081 \
    --subscriptions webserver,system --cache-dir /var/lib/sensu

sensuctl and Docker

It’s best to run sensuctl locally and point it at the exposed API port for your sensu-backend process. The sensuctl utility stores configuration locally, and you’ll likely want to persist it across uses. While it can be run from the docker container, doing so may be problematic.