CentOSLinuxTutorials

How To Install Sensu on CentOS 7

Install Sensu on CentOS 7

In this tutorial, we will show you how to install Sensu on your CentOS 7 server. For those of you who didn’t know, For those of you who didn’t know, 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 which 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 the step-by-step installation of Sensu monitoring on a CentOS 7 server.

Prerequisites

  • A server running one of the following operating systems: CentOS 7.
  • It’s recommended that you use a fresh OS install to prevent any potential issues
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, you can harm your system if you’re not careful when acting as the root.

Install Sensu on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing Erlang.

Install Erlang using the command:

wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
yum install erlang

Step 3. Installing RabbitMQ.

The first thing to do is to go to RabbitMQ’s download page and download the latest stable version of RabbitMQ, At the moment of writing this article it is version 3.6.1:

wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc

Installing RabbitMQ and related packages are now as simple as running just one command:

yum install rabbitmq-server-3.6.1-1.noarch.rpm

To start, stop, restart and check the RabbitMQ status, use the following:

# To start enable boot service:
systemctl enable rabbitmq-server

# To start the service:
systemctl start rabbitmq-server

# To stop the service:
systemctl stop rabbitmq-server

# To restart the service:
systemctl restart rabbitmq-server

# To check the status:
systemctl status rabbitmq-server

Step 4. Installing Redis.

Next, we will be installing Redis:

yum install redis

Finally, we will start the Redis services and enable them to auto-start:

systemctl start redis-server.service
systemctl enable redis-server.service

Step 5. Installing Sensu.

First, create a yum repository for in /etc/yum.repos.d:

### nano /etc/yum.repos.d/sensu.repo

[sensu]
name=sensu-main
baseurl=http://repositories.sensuapp.org/yum/el/7/x86_64/
gpgcheck=0
enabled=1

Then save and close the file.

Install and start the Sensu services:

yum install sensu uchiwa -y

Create a sample Sensu configuration file:

cp /etc/sensu/config.json.example /etc/sensu/config.json

Start Sensu and Uchiwa and enable auto-start:

systemctl start sensu-server
systemctl start sensu-client
systemctl start sensu-api
systemctl start uchiwa
systemctl enable sensu-server
systemctl enable sensu-client
systemctl enable sensu-api
systemctl enable uchiwa

Step 6. Accessing Sensu.

Sensu will be available on HTTP port 3000 by default. Open your favorite browser and navigate to http://your-domain.com:3000 or http://server-ip:3000 and complete the required steps to finish the installation. If you are using a firewall, please open port 3000 to enable access to the control panel.

Congratulations! You have successfully installed Sensu. Thanks for using this tutorial for installing Sensu monitoring on CentOS 7 systems. 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 the best deal!

Save

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button