The Five Minute Install

The Five Minute Install

Objective

Although Sensu’s architecture is one of its most compelling features, and the complete installation guide can help you get Sensu installed and configured for a variety of operating environments, you might not actually care about any of that until you can get Sensu up and running in a development environment for testing purposes. This installation guide is intended to help you to install Sensu Core in five minutes or less, or we’ll give you your money back, guaranteed.

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 command-line interface
  • Willingness to run a shell script downloaded from the internet (or not)
  • The commitment to count to ten (the number of steps in this guide)
  • 300 seconds (the amount of time it should take to complete this installation)

Ready? Let’s get started!

Install Sensu in 5-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, and/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 or see Sensu Enterprise repository instructions:

echo '[sensu]
name=sensu
baseurl=https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch/
gpgcheck=0
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 Sensu:

For Sensu Core:

sudo yum install sensu uchiwa -y

Or for Sensu Enterprise:

sudo yum install sensu sensu-enterprise sensu-enterprise-dashboard -y

6. Configure Sensu server

Run the following to set up a minimal client config:

echo '{
  "transport": {
    "name": "redis"
  },
  "api": {
    "host": "127.0.0.1",
    "port": 4567
  }
}' | sudo tee /etc/sensu/config.json

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 a Sensu dashboard

Sensu Core users:

 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

Sensu Enterprise users:

echo '{
  "sensu": [
    {
      "name": "sensu",
      "host": "127.0.0.1",
      "port": 4567
    }
  ],
  "dashboard": {
    "host": "0.0.0.0",
    "port": 3000
  }
}' |sudo tee /etc/sensu/dashboard.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

Sensu Core users:

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

Sensu Enterprise users:

sudo systemctl enable sensu-{enterprise,enterprise-dashboard,client}
sudo systemctl start sensu-{enterprise,enterprise-dashboard,client}

11. 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 .

If the Sensu API returns a JSON array of Sensu clients similar to this:

$ curl -s http://127.0.0.1:4567/clients | jq .
[
  {
    "timestamp": 1458625739,
    "version": "0.28.0",
    "socket": {
      "port": 3030,
      "bind": "127.0.0.1"
    },
    "subscriptions": [
      "dev"
    ],
    "environment": "development",
    "address": "127.0.0.1",
    "name": "client-01"
  }
]

…you have successfully installed and configured Sensu!

Whether you’re using Uchiwa or Sensu Enterprise Dashboard, you now be able to view it in your browser by visiting http://hostname:3000 (replacing hostname with the hostname or IP address of the system where the dashboard is installed).

five-minute-dashboard-1 five-minute-dashboard-2