Install Sensu Go monitoring tool on CentOS 8 / RHEL 8

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Sensu is an open source monitoring tool that can monitor public, private, hybrid cloud, and container-based infrastructure environments. Sensu is designed as a simple, extensible, and extensible framework that allows you to customize monitoring to meet business needs. This guide will guide you through the process of installing Sensu Go monitoring tool on CentOS 8 / RHEL 8 Linux computer.

Sensu Architecture

Sensu works in a server-client model, where all systems to be monitored run sensu client software. The client application is responsible for performing local inspections, managing client subscriptions and registrations, and completing inspections requested by the Sensu server.

Install Sensu Go on CentOS 8 / RHEL 8

The Sensu monitoring tool is divided into three main parts.

Sensu architecture diagram

Step 1: Install Sensu backend on CentOS 8 / RHEL 8

Add the back-end repository:

curl -s https://packagecloud.io/install/repositories/sensu/stable/script.rpm.sh | sudo bash

If the repository configuration is successful, the output will be as follows.

Complete!
Generating yum cache for sensu_stable...
Importing GPG key 0x0A3F7426:
 Userid     : "https://packagecloud.io/sensu/stable (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: CB16 05C4 E988 C91F 4382 49E3 A5BC 3FB7 0A3F 7426
 From       : https://packagecloud.io/sensu/stable/gpgkey
Generating yum cache for sensu_stable-source...

The repository is setup! You can now install packages.
..

After adding the repository, install the Sensu backend on CentOS 8 / RHEL 8:

sudo yum install sensu-go-backend

Accept the installation prompt:

Dependencies resolved.
========================================================================================================================================================
 Package                                 Architecture                  Version                                Repository                           Size
========================================================================================================================================================
Installing:
 sensu-go-backend                        x86_64                        5.20.1-12427                           sensu_stable                         14 M

Transaction Summary
========================================================================================================================================================
Install  1 Package

Total download size: 14 M
Installed size: 38 M
Is this ok [y/N]: y

Step 2: Configure Sensu backend on CentOS 8 / RHEL 8

Copy the configuration template from the document:

sudo curl -L https://docs.sensu.io/sensu-go/latest/files/backend.yml -o /etc/sensu/backend.yml

Edit to your liking:

sudo vi /etc/sensu/backend.yml

This is my configuration:

---
# Sensu backend configuration

# backend configuration
state-dir: "/var/lib/sensu/sensu-backend"
cache-dir: "/var/cache/sensu/sensu-backend"
config-file: "/etc/sensu/backend.yml"
debug: false
log-level: "debug" # available log levels: panic, fatal, error, warn, info, debug

##
# agent configuration
##
agent-port: 8081

##
# api configuration
##
api-listen-address: "[::]:8080" # listen on all IPv4 and IPv6 addresses
#api-url: "http://localhost:8080"

##
# dashboard configuration
##
#dashboard-cert-file: "/path/to/ssl/cert.pem"
#dashboard-key-file: "/path/to/ssl/key.pem"
dashboard-host: "[::]" # listen on all IPv4 and IPv6 addresses
dashboard-port: 3000

##
# ssl configuration
##
#cert-file: "/path/to/ssl/cert.pem"
#key-file: "/path/to/ssl/key.pem"
#trusted-ca-file: "/path/to/trusted-certificate-authorities.pem"
#insecure-skip-tls-verify: false

##
# store configuration
##
#etcd-advertise-client-urls: "http://localhost:2379"
#etcd-cert-file: "/path/to/ssl/cert.pem"
#etcd-client-cert-auth: false
#etcd-initial-advertise-peer-urls: "http://127.0.0.1:2380"
#etcd-initial-cluster: "default=http://127.0.0.1:2380"
#etcd-initial-cluster-state: "new" # new or existing
#etcd-initial-cluster-token: "sensu"
#etcd-key-file: "/path/to/ssl/key.pem"
#etcd-listen-client-urls: "http://127.0.0.1:2379"
#etcd-listen-peer-urls: "http://127.0.0.1:2380"
#etcd-name: "default"
#etcd-peer-cert-file: "/path/to/ssl/cert.pem"
#etcd-peer-client-cert-auth: false
#etcd-peer-key-file: "/path/to/ssl/key.pem"
#etcd-peer-trusted-ca-file: "/path/to/ssl/key.pem"
#etcd-trusted-ca-file: "/path/to/ssl/key.pem"
#no-embed-etcd: false
#etcd-cipher-suits
#  - TLS_EXAMPLE

For a complete list of configuration options, see Backend reference.

Start the Sensu backend service:

sudo systemctl enable --now  sensu-backend

Check the service status:

systemctl status sensu-backend
● sensu-backend.service - The Sensu Backend service.
   Loaded: loaded (/usr/lib/systemd/system/sensu-backend.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-05-19 21:45:05 CEST; 14s ago
 Main PID: 2194 (sensu-backend)
    Tasks: 11 (limit: 26213)
   Memory: 25.8M
   CGroup: /system.slice/sensu-backend.service
           └─2194 /usr/sbin/sensu-backend start -c /etc/sensu/backend.yml

May 19 21:45:11 cent8.computingforgeeks.com sensu-backend[2194]: {"backend_id":"861176a0-1874-4007-be62-c41f1b048dfe","component":"metricsd","level":"d>
May 19 21:45:12 cent8.computingforgeeks.com sensu-backend[2194]: {"backend_id":"861176a0-1874-4007-be62-c41f1b048dfe","component":"metricsd","level":"d>
May 19 21:45:13 cent8.computingforgeeks.com sensu-backend[2194]: {"backend_id":"861176a0-1874-4007-be62-c41f1b048dfe","component":"metricsd","level":"d>
May 19 21:45:16 cent8.computingforgeeks.com sensu-backend[2194]: {"component":"cache","level":"debug","msg":"rebuilding the cache for resource type *v2>
May 19 21:45:16 cent8.computingforgeeks.com sensu-backend[2194]: {"component":"cache","level":"debug","msg":"rebuilding the cache for resource type *v2>
May 19 21:45:16 cent8.computingforgeeks.com sensu-backend[2194]: {"component":"cache","level":"debug","msg":"rebuilding the cache for resource type *v2>
May 19 21:45:16 cent8.computingforgeeks.com sensu-backend[2194]: {"component":"tessend","level":"debug","metric_name":"auth_provider_count","metric_val>
May 19 21:45:16 cent8.computingforgeeks.com sensu-backend[2194]: {"backend_id":"861176a0-1874-4007-be62-c41f1b048dfe","component":"metricsd","level":"d>
May 19 21:45:17 cent8.computingforgeeks.com sensu-backend[2194]: {"backend_id":"861176a0-1874-4007-be62-c41f1b048dfe","component":"metricsd","level":"d>
May 19 21:45:18 cent8.computingforgeeks.com sensu-backend[2194]: {"backend_id":"861176a0-1874-4007-be62-c41f1b048dfe","component":"metricsd","level":"d>

Step 3: Initialize the Sensu backend

Now, you need to set your Sensu administrator username and password. Run the following command to initialize the Sensu backend:

export SENSU_BACKEND_CLUSTER_ADMIN_USERNAME=admin
export [email protected]
sensu-backend init 

Command execution output:

{"component":"backend.seeds","level":"info","msg":"seeding etcd store with intial data","time":"2020-05-19T21:50:07+02:00"}

If you want to respond to the prompt for the user name and password, you can also run the sensu-backend init command interactively:

sensu-backend init --interactive

For more details Backend initialization, See Backend reference Documentation.

Step 4: Access the Sensu information homepage

Sensu Web UI provides a unified view of monitoring events and user-friendly tools to reduce alarm fatigue.

Confirm that the UI service port is open.

$ sudo ss -tunelp | grep 3000
tcp   LISTEN  0       128                         *:3000                *:*      users:(("sensu-backend",pid=2194,fd=18)) uid:994 ino:27800 sk:a v6only:0 <->   

Check if the backend is up and running by querying API health:

$ curl http://127.0.0.1:8080/health
{"Alarms":null,"ClusterHealth":[{"MemberID":9882886658148554927,"MemberIDHex":"8927110dc66458af","Name":"default","Err":"","Healthy":true}],"Header":{"cluster_id":4255616304056076734,"member_id":9882886658148554927,"raft_term":2}}

If you have an active firewall service, please allow port 3000.

sudo firewall-cmd --add-port=3000/tcp --permanent
sudo firewall-cmd --reload

Open a browser and visit the Sensu dashboard on http: // localhost: 3000 or http: // server_ip_or_hostname: 3000.

Install Sensu Go monitoring tool on CentOS 8 / RHEL 8

Log in using the credentials set previously.

Install Sensu Go monitoring tool on CentOS 8 / RHEL 8

Our next guide will introduce the installation of Sensu agent and sensuctl command line tool.

reference:

More information about monitoring:

Install Nagios 4 on CentOS / RHEL 8

How to install Cacti on RHEL / CentOS 8

How to install Zabbix server on RHEL / CentOS 8

How to install Netdata on RHEL / CentOS 8

Install and configure Telegraf on RHEL / CentOS 8

How to install Prometheus on RHEL / CentOS 8

How to install Grafana on RHEL 8

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Sidebar