The Five Minute Install

This installation guide is intended to help you install Sensu Core in a development environment for testing purposes. To try out Sensu Enterprise, see the Sensu Enterprise quick install guide.

WARNING: This installation guide is not meant for production systems. To install Sensu in production, see the complete installation guide or install Sensu using configuration management.

After completing the steps in this guide, you will have a fully functional Sensu Core installation in a standalone configuration.

Installation Requirements

What will you need to complete this guide?

  • A virtual machine, or physical computer running 64-bit CentOS 7 with a minimum of 2GB of memory (4GB recommended)
  • Familiarity with a text editor and the Linux command-line interface
  • 300 seconds (the amount of time it should take to complete this installation)

Ready? Let’s get started!

Install Sensu in five minutes or less

The following installation steps will help you get Sensu Core installed in a standalone on a system running CentOS 7, only. For installation on other platforms, or alternative installation configurations, please consult the installation guide.

0. Install EPEL (if not already done)

sudo yum install epel-release -y

1. Create the YUM repository configuration file for the Sensu Core repository at /etc/yum.repos.d/sensu.repo

echo '[sensu]
name=sensu
baseurl=https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch/
gpgkey=https://repositories.sensuapp.org/yum/pubkey.gpg
gpgcheck=1
enabled=1' | sudo tee /etc/yum.repos.d/sensu.repo

2. Install Redis (>= 1.3.14) from EPEL:

sudo yum install redis -y

3. Disable Redis protected mode

When using Redis 3.2.0 or later, you will need to edit /etc/redis.conf in order to disable protected mode.

Look for a line that reads:

protected-mode yes

and change it to:

protected-mode no

4. Enable and start Redis:

sudo systemctl enable redis
sudo systemctl start redis

5. Install and start RabbitMQ:

Install Erlang (required for RabbitMQ):

sudo yum install https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7/x86_64/erlang-20.1.7.1-1.el7.centos.x86_64.rpm

Install RabbitMQ:

sudo yum install https://dl.bintray.com/rabbitmq/rabbitmq-server-rpm/rabbitmq-server-3.6.12-1.el7.noarch.rpm

Configure RabbitMQ to work with Sensu:

echo '{
  "rabbitmq": {
    "host": "127.0.0.1",
    "port": 5672,
    "vhost": "/sensu",
    "user": "sensu",
    "password": "secret",
    "heartbeat": 30,
    "prefetch": 50
  }
}' | sudo tee /etc/sensu/conf.d/rabbitmq.json

Start RabbitMQ:

sudo systemctl start rabbitmq-server
sudo systemctl enable rabbitmq-server

Create a RabbitMQ vhost and user to allow Sensu services to connect to RabbitMQ:

sudo rabbitmqctl add_vhost /sensu
sudo rabbitmqctl add_user sensu secret
sudo rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"

6. Install Sensu and the Uchiwa dashboard:

sudo yum install sensu uchiwa -y

7. Configure the Sensu client:

Run the following to set up a minimal client config:

echo '{
  "client": {
    "environment": "development",
    "subscriptions": [
      "dev"
    ]
  }
}' |sudo tee /etc/sensu/conf.d/client.json

8. Configure the Uchiwa dashboard:

 echo '{
   "sensu": [
     {
       "name": "sensu",
       "host": "127.0.0.1",
       "port": 4567
     }
   ],
   "uchiwa": {
     "host": "0.0.0.0",
     "port": 3000
   }
 }' |sudo tee /etc/sensu/uchiwa.json

9. Make sure that the sensu user owns all of the Sensu configuration files:

sudo chown -R sensu:sensu /etc/sensu

10. Start the Sensu services:

sudo systemctl enable sensu-{server,api,client}
sudo systemctl start sensu-{server,api,client}
sudo systemctl enable uchiwa
sudo systemctl start uchiwa

Nice work! You have successfully installed and configured Sensu.

You can verify that your installation is ready to use by querying the Sensu API using the curl utility (and piping the result to the jq utility):

sudo yum install jq curl -y
curl -s http://127.0.0.1:4567/clients | jq .

The Sensu API should return a JSON array of Sensu clients similar to this:

[
  {
    "name": "localhost.localdomain",
    "address": "10.0.2.15",
    "environment": "development",
    "subscriptions": [
      "dev",
      "client:localhost.localdomain"
    ],
    "version": "1.5.0",
    "timestamp": 1536689149
  }
]

You can also use the settings API to see Sensu’s full configuration:

curl -s http://127.0.0.1:4567/settings | jq .

You now be able to view the Uchiwa dashboard in your browser by visiting http://hostname:3000 (replacing hostname with the hostname or IP address of the system where the dashboard is installed).

Now you’re ready to start building monitoring event pipelines with Sensu!