×
Sensu Beginner's Guide

Sensu is an open-source monitoring solution that can help monitor applications and infrastructure. With Sensu, users can keep track of the health of servers and applications while integrating with third-party tools. This can help in delivering notifications and alerts. Written in Ruby, this messaging system can process messages by adopting either Redis or RabbitMQ. Data can be stored in Redis by making use of this system.

Sensu represents an agent-based observability tool that can be installed on an organization’s infrastructure. With the Sensu backend, users can acquire a flexible, automated pipeline to help filter, transform, and process metrics and alerts. Sensu Go is a developer-friendly and operator-focused tool that can integrate with popular observability and monitoring tools. It is possible to adopt Sensu Go for on-premises and public cloud infrastructures, containers, and other environments.

For users who wish to monitor the infrastructure of their cloud effectively and straightforwardly, then Sensu is a good tool that should be considered. Users can combine it with numerous modern DevOps stacks, including HipChat, Slack, or IRC. To learn more about how Sensu works, this guide will provide a deep insight into all beginners and users who should know about Sensu. So, keep on reading!

Architecture

The main mechanism for communication for Sensu is Transport. All Sensu components must connect to the Transport to send messages to one another. Transport can adopt either Redis or RabbitMQ. 

Sensu Server promotes the processing of event data while taking action. It can register clients and process check results while keeping track of events by using filters, handlers, and mutators. The server publishes check definitions to the clients. Then, the Sensu API offers a RESTful API, which offers access to core functionality.

With Sensu Client, it is possible to implement checks, which Sensu Server schedules. Sensu uses Redis (a data store), which helps keep all the persistent data. Uchiwa is the web interface that can communicate with the Sensu API.

The setting up of instrumentation, including scripts or plugins, alongside the configuration of new monitors, is made easy with the use of Sensu. This example makes it easy to monitor the clock drift on an NTP system.

What Does Sensu Do?

Sensu is hosted in the cloud, and it allows companies to gather data and diagnostics related to performance. The program originates with a module that can arm the network team with the ability to monitor ephemeral container infrastructures, including Red Hat OpenShift, Kubernetes, Cloud Foundry, Docker, and Mesos. Some of the most important functions of this network monitoring service include bandwidth monitoring, server performance monitoring, and event logging.

What Are the Key Features?

Some of the important features of Sensu are provided in this section.

  • Capable of monitoring everything, including cloud computing, mainframes, and containers. 
  • Can control the monitoring of both the availability of applications and their performance from a unified, centralized platform.
  • Users can interface with their already established tools, including ElasticDB, Grafana, and InfluxDB, which contribute to the optimization of the user process.
  • Users can create incidents while developing solutions to issues as soon as they occur. This is due to automated alerts delivered through email, PagerDuty, and Slack.
  • By using ElasticSearch, Splunk, and InfluxDB, it is easy to gather and store container and application metrics at any given time from any particular location. 

With this system, teams can gather metrics from StatsD and Prometheus. Then, they can store the gathered information with the use of technologies like Splunk, InfluxDB, and ElasticSearch. With this solution, network administrators can monitor large-scale environments. This is done by considering certain network topologies, including VPNs, firewalls, and NATs. Sensu provides notifications on the health of a server across various nodes. This is interoperable with monitoring systems, including Zabbix and Nagios.

Sensu offers an open-source, free framework, which is regarded as Sensu Core, besides a version called Sensu Enterprise. With Sensu, consumers can access a single and centralized management platform. From this, users can monitor the performance and availability of their applications. This is associated with various capabilities, including metrics and service checks.

Advantages of Using Sensu

  • Sensu Go, the latest version, is easy to set up.
  • Sensu is also simple to manage and scale.
  • The end-to-end observability that Sensu supports makes it easy for users to gather, filter, and transform monitoring events.
  • Sensu is customizable, and users can set different thresholds for different servers.
  • It provides unlimited integration possibilities.
  • Users can embrace auto-scaling with confidence.
  • With Sensu, it is possible to register and deregister servers.

What Can Be Improved on Sensu?

  • The graphical user interface needs to be significantly improved. After all, this appears to be basic, especially when compared to Nagios XI.
  • Documentation might require a good level of expertise to carry out.

Sensu provides compatibility with Nagios, Prometheus, and alerts, as well as enterprise-grade connectors, such as Jira, Splunk, and ServiceNow. With the help of Sensu, users can maintain total visibility over the entire infrastructure, which is required for both private and public cloud environments. It is also possible for users to gather analytics that is related to applications and containers while storing them at any chosen location, including Splunk and ElasticSearch.

How to Install Sensu

Getting started with Sensu is quite easy. It should take just a few minutes to do this. To lend you a hand, this section will take a deep dive into the installation of Sensu. First, we must consider the prerequisites that are required to install Sensu. These are listed as follows:

  • One Linux installation. This will act as the server node.
  • One or multiple Linux machines that can monitor clients. 

To install Sensu, users must first install Redis. You should enable the EPEL repository to install Redis:

$ sudo yum install epel-release -y

To install Redis,

$ sudo yum install redis -y

If you wish to disable protected mode, listen on every interface, and set a password, then modify /etc/redis.conf.

$ sudo sed -i ‘s/^protected-mode yes/protected-mode no/g’ /etc/redis.conf

$ sudo sed -i ‘s/^bind 127.0.0.1/bind 0.0.0.0/g’ /etc/redis.conf

$ sudo sed -i ‘s/^# requirepass foobared/requirepass password123/g’ /etc/redis.conf

Then, you should enable and start the Redis service by inputting

$ sudo systemctl enable redis

$ sudo systemctl start redis

With this, you have successfully installed Redis, which is needed to be used by Sensu – as mentioned earlier.

The next step is to install Sensu.

The first thing to do is to configure the Sensu repository and install the packages.

$ sudo tee /etc/yum.repos.d/sensu.repo << EOF

[sensu]

name=sensu

baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/

gpgcheck=0

enabled=1

EOF

$ sudo yum install sensu uchiwa -y

Then, you can create the bare minimum configuration for Sensu:

 $ sudo tee /etc/sensu/conf.d/api.json << EOF

{

  “api”: {

        “host”: “127.0.0.1”,

        “port”: 4567

  }

}

EOF

After this, you can configure sensu-api to listen on localhost, with Port 4567

$ sudo tee /etc/sensu/conf.d/redis.json << EOF

{

  “redis”: {

        “host”: “<IP of server>”,

        “port”: 6379,

        “password”: “password123”

  }

}

EOF

 $ sudo tee /etc/sensu/conf.d/transport.json << EOF

{

  “transport”: {

        “name”: “redis”

  }

}

EOF

These are two different files; in them, you can configure Sensu to use Redis as the transport mechanism and the address where Redis will listen. There is a need for clients to connect directly to the transport mechanism. Each client machine will require two files.

$ sudo tee /etc/sensu/uchiwa.json << EOF

{

   “sensu”: [

        {

        “name”: “sensu”,

        “host”: “127.0.0.1”,

        “port”: 4567

        }

   ],

   “uchiwa”: {

        “host”: “0.0.0.0”,

        “port”: 3000

   }

}

EOF

In this file, Uchiwa is configured to listen to each interface (0.0.0.0) on Port 3000. Uchiwa is also configured to make use of sensu-api. 

You can also change the owner of the configuration files that have just been created for any security purpose:

$ sudo chown -R sensu:sensu /etc/sensu

Enable and Start the Sensu Services:

  • $ sudo systemctl enable sensu-server sensu-api sensu-client
  • $ sudo systemctl start sensu-server sensu-api sensu-client
  • $ sudo systemctl enable uchiwa
  • $ sudo systemctl start uchiwa

Try accessing the Uchiwa website: http://<IP of server>:3000

It is often recommended to operate a cluster of RabbitMQ as the Transport rather than Redis for the production environment. This can also be used to run multiple instances of Sensu Server and API, which are needed for high availability and load balancing.

With this, the installation of Sensu is now complete. The next thing is to configure the clients.

If you wish to add a new client, you must enable the Sensu repository on the client machine. This is done by creating the file /etc/yum.repos.d/sensu.repo

Then, 

$ sudo tee /etc/yum.repos.d/sensu.repo << EOF

[sensu]

name=sensu

baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/

gpgcheck=0

enabled=1

EOF

This enables the repository. Then, you can install the package Sensu:

 $ sudo yum install sensu -y

Create the same redis.json and transport.json created in the server machine, in addition to the client.json configuration file, if you wish to configure sensu-client

$ sudo tee /etc/sensu/conf.d/client.json << EOF

{

  “client”: {

        “name”: “rhel-client”,

        “environment”: “development”,

        “subscriptions”: [

        “frontend”

        ]

  }

}

EOF

Identifying the client by specifying a name in the name field is important. To filter, make use of the environment field. Then, enable and start the services while checking in Uchiwa. The new client will register automatically.

  • $ sudo systemctl enable sensu-client
  • $ sudo systemctl start sensu-client

Are There Any Featured Integrations?

Integrations with Sensu involve plugins and libraries, which ensure that users can boost Sensu’s functionality while automating a user’s observability and monitoring workload. Users can make use of these integrations to get their work done. The Sensu Marketplace is a platform where these integrations are available.

These integrations are specific to the service. As a result, they are often associated with their unique needs for installing and configuring them. Many of these offered integrations are associated with well-crafted quick-start templates, which only demand slight adjustments on the user’s part. These integrations are designed with their distinct, self-contained documentation, which provides a deep insight into how to install and adopt the integration for use.

Besides this, it must be stressed that users can easily find more enterprise-level, supported, and community-tier integration at an asset hub reserved for Sensu (Bonsai). You can easily collect any relevant information from a trusted source. Transfer this to the tools that are already being utilized in the workflow.

Sensu can work well with other tools that are already being utilized.

Furthermore, Sensu can also gather data from every mission-critical system, such as cloud platforms like AWS and Kubernetes, as well as web platforms like Splunk or Apache. Users can also send data to the database of their choice while also automating notifications by utilizing the incident management platform of their choice and automating monitoring and remediation by making use of the configuration management tools that are already available.

There are plugins and dynamic runtime assets, which users can access through Sensu. They can be found in a database that can be searched relatively easily. This makes it easy for users to locate their preferred monitoring solutions and share them on time.

The following are relevant platforms to note:

  • Cloud Platforms Sensu is operational on many platforms. Some of these include Google Cloud Platform, AWS, Microsoft Azure, OpenStack, Red Hat OpenShift, and Docker. With Sensu, users can keep a close watch on the cloud platform they prefer.
  • Storage Platforms Users can also send observability and monitoring data to multiple databases and services, such as Splunk, Elasticsearch, Postgres, MySQL, Redis, Kafka, Cassandra, and MongoDB. This data must be analyzed and correlated with many other business variables. This will help in improving business intelligence.
  • Web Platforms Users can also adopt Sensu to monitor different web platforms they might be using already. Some of these platforms that can work with Sensu include Apache, Microsoft IIS, NGINX, Memcache, HA Proxy, and many more.
  • Platforms for Automated Processes Users can make use of Sensu to automate their monitoring. This can help in keeping a close watch on your configuration management tools, including Chef, Puppet, Terraform, Ansible, and Pulumi, among others. 
  • Third-Party Monitoring Instruments Sensu supports seamless integration with various monitoring instruments that a user may be using. Some of these include Nagios, Prometheus, SNMP, StatsD, and more. This will offer you full visibility of your infrastructure.
  • Incident Management It is also possible for Sensu to automatically create occurrences in ServiceNow, Pagerduty, OpsGenie, JIRA, VictorOps, and others. Existing incidents can be updated and resolved.

Pricing

Sensu is a versatile tool that organizations adopt, from startups to multinational organizations. For this reason and more, many users find the tool cost-effective. Besides the free trial that many new users can enjoy, there is also an available free version. However, getting the best features implies that users need to acquire the paid version. The pricing model is available per feature. To get one, a user must consider a price per feature that begins at $600.

How Effective is Sensu?

Over the years, a dramatic shift from static to dynamic infrastructure has occurred. With this in mind, there is a need for a change in approach when it comes to monitoring, particularly from host-based to one-based on functional role. For this reason, Sensu is one of the best tools that has been gaining lots of attention, thanks largely to the unlimited integration potential it provides.

In the world of network administration, Sensu is regarded as an effective tool for monitoring applications and networks. Users find it a good value for money. Its ease of use, as well as its reliable customer support, makes it likely to be recommended by users. Sensu has great community features, including plugins, which make it easy for users to make the most of various community contributions. In addition to this, the fact that Sensu supports complete documentation makes it a reliable tool for users to adopt. The various features and its integration with other third-party tools make Sensu one of the best monitoring tools in the network administration world. 

Conclusion

Compared with many other systems, including GroundWork and Opsview, Sensu’s presentation can boast some differences. Yet, using it as a code presents many opportunities. A major benefit of using Sensu is that it can be easily integrated with many third-party tools. With Sensu, users can easily monitor infrastructure and applications.

In addition to this, even though installing Sensu requires the installation of Redis, this process is quite straightforward once the right information – as provided above – is available. With Sensu, it is possible for users to create incidents while also creating solutions to issues anytime they occur.