How To Install Sensu on Ubuntu 16.04 LTS

Install Sensu on Ubuntu 16.04 LTS

In this tutorial we will show you how to install Sensu on Ubuntu 16.04. For those of you who didn’t know, Sensu is a free and open source tool for composing the monitoring system you need. It is written in Ruby that uses RabbitMQ to handle messages and Redis to store data. Sensu provides a framework for monitoring infrastructure and application health. Sensu supports a number of platforms such as, IBM AIX, Ubuntu, Debian, RedHat, CentOS, FreeBSD, Mac OS, Solaris, Windows and much more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Sensu monitoring on an Ubuntu 16.04 Xenial Xerus server.

Install Sensu on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing RabbitMQ.

Add Erlang repository as RabbitMQ runs on the Erlang runtime:

Add Erlang public key to your trusted key list:

Install RabbitMQ along with Erlang using the following command:

At this point, we can download and install RabbitMQ. As we have done for Erlang, first of all it is required to add the RabbitMQ repository:

Update the repositories and install RabbitMQ server with the following apt command:

Once installation is complete, start RabbitMQ and enable it to start at boot time. Execute the commands:

Step 3. Installing Redis.

By default, Redis is available in Ubuntu repository, so we can install it by executing the following command:

Once the installation is complete, we can start Redis and enable it to start at boot time:

Verify that Redis is ready to use by running the below command:

Step 4. Installing Sensu.

First, Install GPG public key and add APT configuration file at /etc/apt/sources.list.d/sensu.list:

Install Sensu using the following command:

Step 5. Configure Sensu.

Sensu processes require extra configuration to tell them how to connect to the RabbitMQ transport bus:

Update the file with following values. Replace password with the password you chosen few steps back:

Next, Create redis.json file to include the connection information for Sensu to access Redis:

Add the below lines to the above file:

Create api.json file to include the connection information for Sensu to access API service:

Add below lines to the above file:

Step 5. Installing Uchiwa.

Sensu core does not come with the monitoring dashboard, so you would need to install Uchiwa which is an open source dashboard for Sensu:

Once the installation is finished, create a configuration file for Uchiwa:

Here, paste the following content:

Finally, restart Sensu and Uchiwa and enable them to start at boot time:

Congratulation’s! You have successfully installed Sensu. Thanks for using this tutorial for installing Sensu monitoring on your Ubuntu 16.04. For additional help or useful information, we recommend you to check the official Sensu website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!