googleads
How To Get Started With Sensu – A Full Stack Monitoring Tool
preloder
Standard

How To Get Started With Sensu – A Full Stack Monitoring Tool

What Is Sensu?

Sensu’s is an open source platform that provides the full stack monitoring solution for your problems. Through Sensu you can progressively monitor your servers, services, application health, and business KPIs etc. On other hand,  it can also collect and analyze custom metrics. And it can keep you updated when something happens, you will be notified through email or phone call (customized) . Precisely you can do all these competitive monitoring analysis for your business with Sensu.

Steps are required to configure Sensu for Linux and Ubuntu platform.

  • Sensu Installation and configuration
  • Install and Configure RabbitMQ
  • Install Redis server
  • Install and Configure Uchiwa Dashboard Setup  
  • Installing & Configuring Plugins
  • Enabling Email Alerts Using Postfix 

Sensu Installation and configuration

Before installing Sensu, it is recommended to update your system to the latest stable version.
You can use the below command to update your system

 

Install and Configure RabbitMQ

RabbitMQ supports multiple messaging protocols. Its can be deployed in distributed and federated configurations to meet high-scale availability.
The following command will add Erlang repository and will add Erlang public key to your trusted key list.
sudo wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb

 

sudo wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add –
Next, update the repository with below command

 

Once the repository is updated, install Erlang-nox

 

Next, We need to download and install the latest version of RabbitMQ repository.
sudo wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server_3.6.10-1_all.deb

 

Update the repository

 

Finally, Install the RabbitMQ server using the following command

 

After installing rabbitmq-server , Start the  RabbitMQ service and enable it.

 

Next, we need to create a RabbitMQ vhost and user for Sensu application.

 

Use the following command to provide the permission for users to access Sensu

sudo rabbitmqctl set_permissions -p /sensu sensu “.*” “.*” “.*”

[Related: Tips To Optimize Angular Application To Increase The Website Speed ]

Installing Redis Server

Once you are done with the RabbitMQ configuration,  then start installing Redis server. Because Sensu uses Redis server to store their data.
Note:
Redis is an open source , in-memory data structure store, used as a database, cache and message broker.
Install Redis Server with below command,

 

Once the redis-server installation is complete, start the Redis server and enable it.

 

 

Sensu Installation

First, add Sensu GPG key
sudo wget -O- https://sensu.global.ssl.fastly.net/apt/pubkey.gpg | sudo apt-key add –
Next, add the Sensu repository by creating sensu.list file inside /etc/apt/sources.list.d
sudo vi /etc/apt/sources.list.d/sensu.list

Then add the following line
deb https://sensu.global.ssl.fastly.net/apt sensu main
Next, update the repository

 

Now, use the following command to install the Sensu

 

After  installing Sensu, you will need to configure Sensu for RabbitMQ and Redis.
By default, Sensu will load configuration from /etc/sensu/conf.d/ directory.
Now copy and paste the below code to create a rabbitmq.json file inside the following directory /etc/sensu/conf.d

File path :  sudo vi /etc/sensu/conf.d/rabbitmq.json

 

Next, create redis.json file with the following command

File path :  sudo vi /etc/sensu/conf.d/redis.json

 

Next, create a api.json file to include the connection information for Sensu to access API
File path :  sudo vi /etc/sensu/conf.d/api.json

 

 

Install and Configure Uchiwa Dashboard 

Basically Sensu does not come with the Dashboard to monitor Sensu through web interface. So, we need to install an open source Dashboard Uchiwa to your system.

  • Add the public key to the Uchiwa repository

sudo wget -O- https://sensu.global.ssl.fastly.net/apt/pubkey.gpg | sudo apt-key add –

File Path: /etc/apt/sources.list.d

 

Add this repository  to the uchiwa.list file.

 

Next, update the repository

 

Once the system is updated, install Uchiwa

 

The following command user to configuration file for Uchiwa dashboard.

File path : sudo vi /etc/sensu/uchiwa.json

 

Next, configuration file for Uchiwa client

File path : /etc/sensu/conf.d/client.json

 

Next add transport file to the following location

File Path: sudo vi /etc/sensu/conf.d/transport.json

 

Finally use the following command to restart & enable the Sensu and Uchiwa service.

 

Now you can  monitor your Dashboard through access path :  http://127.0.0.1:3001 or http://<yourpublicip>:<your givenpostnumber>

Plugin Installation & Configurations

Here i have explained the configuration process for primary plugins and you can also add more plugins if required,

Go to the following location and run the listed commands to install the plugins

cd /opt/sensu/embedded/bin/

 

Configuring CPU Check File

Copy and paste the below code to the specified path.

Configuration Path:  Sudo vi /etc/sensu/conf.d/check_cpu.json

Code

 

Similarly, you can configure all the plugins as listed,

Configuring Memory Check File

Configuration Path: sudo vi /etc/sensu/conf.d/check_memory.json

Code

 

Configuring Disk Usage File

Configuration Path:  sudo vi /etc/sensu/conf.d/check_disk_usage.json

Code

 

Configuring Nginx Service File

Configuration Path:  sudo vi /etc/sensu/conf.d/nginx_process.json

Code

 

Enabling Email Alerts Using Postfix

 

After installing and configuring postfix, include the following json handler files

sudo vi etc/sensu/conf.d/ handler_mail.json

 

 

Finally, Restart the services

 

 

Now you can monitor the Dashboard through the access path :  http://127.0.0.1:3001 or http://<yourpublicip>:<your givenpostnumber>

The following two tabs change content below.

Manigandan

An ideal Full Stack Developer, having around 5+ years of experience in web development arena, expertise in AngularJS, Nodejs, PHP and also scoring 6 years of experience in Networking & Window servers. A perfect all-rounder has fondness to play diverse role. he always strives to match perfection and likely remains the best in whatever role he takes.

Leave a Reply

Your email address will not be published. Required fields are marked *

[contact-form-7 id="120788" title="Web Page Form"]

Schedule Your Call