• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
WebSetNet

WebSetNet

Technology News

  • Technology News
    • Mobile
    • Games
  • Internet Marketing
  • System Admin
    • Windows 11
    • Linux
    • Mac & Apple
    • Website Scripts
      • Wordpress
You are here: Home / Monitoring: How To Install Sensu on Ubuntu 16.04 Server

Monitoring: How To Install Sensu on Ubuntu 16.04 Server

August 5, 2020 by Martin6

 

Sensu is a free and open source tool for composing a monitoring system. It is entirely written in Ruby. It uses RabbitMQ to handle messages and Redis to store its data.
Sensu focuses on composability and extensibility, allowing to reuse monitoring checks and plugins from tools like Nagios and Zabbix.
This framework was designed to work with software like Puppet, Chef and Ansible, and it does not required additional workflow.
As stated in the documentation, “all versions of Sensu (including Sensu Enterprise) are based on the same core components and functionality, which are provided by the Sensu open-source software project and collectively referred to as Sensu Core. Sensu Core provides multiple processes, including the Sensu server (sensu-server), Sensu API (sensu-api), and Sensu client (sensu-client).

Installer packages are available for most modern operating systems via native installer packages (e.g. .deb, .rpm, .msi, .pkg, etc) which are available for download from the Sensu website, and from package manager repositories for APT (for Ubuntu/Debian systems), and YUM (for RHEL/CentOS).”

In this tutorial we will show how to install Sensu on an Ubuntu 16.04 server.

Install RabbitMQ

RabbitMQ runs on top of Erlang, so, first of all, we will install Erlang in our server.

Erlang is not available in Ubuntu repositories, but provides its own. Let’s add it and the Erlang public key to the trusted key list, by executing the following command:

$ wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
# dpkg -i erlang-solutions_1.0_all.deb
$ wget -O- https://packages.erlang-solutions.com/ubuntuerlang_solutions.asc | sudo apt-key add -

Next, update the repositories list with the following apt command:

# apt-get update -y

Once apt has updated its list, it is possible to install Erlang by executing the following command:

# apt-get install socat erlang-nox

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:

$ wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server_3.6.10-1_all.deb
# dpkg -i rabbitmq-server_3.6.10-1_all.deb

Update the repositories list with the following command:

# apt-get update

Finally, we can install RabbitMQ server with the following apt command:

# apt-get install rabbitmq-server

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

# systemctl start rabbitmq-server
# systemctl enable rabbitmq-server

Create vhost and User for Sensu

Next, we need to create a RabbitMQ vhost and user for Sensu. You can do this by running the following command:

# rabbitmqctl add_vhost /sensu
# rabbitmqctl add_user sensu your-password
# rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"

At this point, we can install the Redis server.

Install Redis Server

As anticipated in the introduction, Sensu uses Redis server to store data.
By default, Redis is available in Ubuntu repository, so we can install it by executing the following command:

# apt-get install redis-server apt-transport-https -y

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

# systemctl start redis-server
# systemctl enable redis-server

Install and Configure Sensu

The next step is to install Sensu. It is not available in Ubuntu repositories, but, as we said in the introduction, the project provides its own repository for Ubuntu. Add Sensu public key and repository to apt repositories list.

First of all, add the key, by executing the following gpgcommand:

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

Next, we need to add the Sensu repository. Create a sensu.list file in /etc/apt/sources.list.d directory:

# $EDITOR /etc/apt/sources.list.d/sensu.list

In this file, paste the following content:

deb https://sensu.global.ssl.fastly.net/apt xenial main

Save and exit. Update the repositories list:

# apt-get update

Finally, install Sensu:

# apt-get install sensu

Configure Sensu

Once the installation is finished, we need to configure Sensu for using with RabbitMQ and Redis. By default, Sensu will load configuration from /etc/sensu/conf.d/ directory. This is where we will create the RabbitMQ, Redis, and Api configuration files.

For the RabbitMQ part, create a rabbitmq.json file in /etc/sensu/conf.d:

# $EDITOR /etc/sensu/conf.d/rabbitmq.json

To connect Sensu to RabbitMQ, paste the following content in the opened file:

{
 "rabbitmq": {
     "host": "127.0.0.1",
     "port": 5672,
     "vhost": "/sensu",
     "user": "sensu",
     "password": "your-password"
   }
}

Save and exit.

Next, in the same way, create the redis.json file:

# $EDITOR /etc/sensu/conf.d/redis.json

There, paste the following content:

{
 "redis": {
 "host": "127.0.0.1",
 "port": 6379
 }
}

Save and exit

Next, create the api.json file:

# nano /etc/sensu/conf.d/api.json

Paste the following lines:

{
 "api": {
 "host": "localhost",
 "bind": "0.0.0.0",
 "port": 4567
 }
}

Save and exit.

Install and Configure Uchiwa Dashboard

By default, after the installation Sensu does not provide the Dashboard to monitor Sensu through a user-friendly web interface.

The framework was originally designed as an API-based monitoring solution, enabling operations teams to compose monitoring solutions where Sensu provides the monitoring instrumentation, collection of telemetry data, scalable event processing, comprehensive APIs and plugins for sending data to dedicated dashboard solutions. However, as the project matured, it was natural to work on a monitoring interface. As a result, today there are two dashboards: Uchiwa (for Sensu Core users), and the Sensu Enterprise Dashboard (for Sensu Enterprise customers).
In this tutorial, we will install the Uchiwa Dashboard.

First, add the public key by executing the following command:

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

Next, add a Uchiwa repository by creating the uchiwa.list file inside the /etc/apt/sources.list.d directory:

# $EDITOR /etc/apt/sources.list.d/uchiwa.list

Here, paste:

deb https://sensu.global.ssl.fastly.net/apt xenial main

Save and exit.
Next, update the repositories list with the following command:

# apt-get update

Once apt has updated its repositories list, we can install Uchiwa by executing the following command:

# apt-get install uchiwa

Configure Uchiwa

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

# nano /etc/sensu/conf.d/uchiwa.json

Here, paste the following content:

{"sensu": [      { "name": "Sensu",        "host": "localhost",        "port": 4567, "timeout": 10      }   ],   "uchiwa": {        "host": "0.0.0.0",        "port": 3000,       "refresh": 10        }  }

Save and exit.

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

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

Configure UFW Firewall

Uchiwa listens on port 3000, so we need to allow it through the UFW firewall. Execute the following command:

# ufw allow 3000

Conclusion

This concludes the tutorial. We have seen how to install and configure Sensu and the Uchiwa Dashboard on a server running Ubuntu 16.04.

The post Monitoring: How To Install Sensu on Ubuntu 16.04 Server appeared first on Unixmen.

Related posts:

  1. How to Install RabbitMQ Server on CentOS 7
  2. How to Set up RabbitMQ Cluster on CentOS 7
  3. Install Taiga.io Agile Project Management Software on Ubuntu 16.04
  4. How to Install the Latest Erlang on Ubuntu Linux
  5. Install Redis and Redis PHP on cPanel
  6. How to Install, Configure and Use Redis on Ubuntu 16.04
  7. How to Speed Up WordPress with Redis Caching
  8. List of PPA Repositories for Ubuntu 17.04 Zesty Zapus
  9. Ubuntu 17.04 "Zesty Zapus" All Flavors Download Links
  10. Things to do After Installing Ubuntu 18.04

Filed Under: Uncategorized Tagged With: install, monitoring, sensu, server, Ubuntu

Primary Sidebar

Popular posts

  • 5 Ways to Fix “Your SIM sent a Text Message” Issue on iPhone
  • 3 Ways to Disable GetApps on Xiaomi, Redmi, and Poco Phones Running MIUI
  • GeForce Experience not finding games? Fix it fast
  • How To Extract & Install tar.gz Files In Ubuntu
  • How to Highlight Duplicates in Google Sheets
  • Discord Stream Has No Sound? 6 Ways to Fix
  • How to check if your Android device supports Widevine DRM
  • Exclamation Mark on Network Signal, Mobile Data Not Working? 8 Ways to Fix
  • How to find a lost Apple Pencil using your iPad (1st and 2nd gen)
  • 8 Best Sites to Read Manga Online for Free
  • 3 Ways to Hide Tabs in Google Chrome
  • How to Fix YouTube Server Connection Error [400] on Android
  • How to Track a Stolen or Lost Nintendo Switch
  • How To Search On Google Using Image or Video
  • How To Calculate CAGR in Excel
  • Microsoft Edge's newest feature? Shopping in Microsoft Edge
  • How to Change the Last Modified Date, Creation Date, and Last Accessed Date for Files and Folders

Footer

Tags

Amazon android Apple Asus available download: edge feature features first free from galaxy Game games gaming gets google install Intel iPhone launches linux Microsoft more OnePlus phone release released review: samsung series support this Ubuntu update using video watch what will windows with xbox your

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org