How to install Sensu

Monitor your servers is highly important to ensure that the service you offer is accessible to customers, so you need a monitoring tool, but which one you choose? in this blog post, we’ll talk about Sensu.

What is Sensu?

Sensu is a monitoring tool and observability pipeline that enable Monitoring-as-Code

What does Monitoring-as-Code mean?

With Monitoring-as-Code you can manage your monitoring the same way you manage your code, for example, keep versions of monitoring configuration pipelines and commit them to a code repository, etc.

What does observability mean in this context?

Sensu handles the discovery of new compute instances and containers like Docker and starts monitoring them.

How to install Sensu?

Let’s install Sensu using Docker

sudo docker network create sensu
sudo docker volume create sensu-backend-data

Start the Sensu backend

sudo docker run -v sensu-backend-data:/var/lib/sensu \
-d --name sensu-backend \
--rm --network sensu -p 3000:3000 -p 8080:8080 -p 8081:8081 \
-e SENSU_BACKEND_CLUSTER_ADMIN_USERNAME=admin \
-e SENSU_BACKEND_CLUSTER_ADMIN_PASSWORD=admin \
sensu/sensu:latest \
sensu-backend start --state-dir /var/lib/sensu/sensu-backend --log-level debug

How to install Sensu Agent?

Again let’s use Docker

sudo docker run -d --rm --network sensu -p :3030 \
  sensu/sensu sensu-agent start \
  --backend-url ws://sensu-backend:8081 --deregister \
  --keepalive-interval=5 --keepalive-warning-timeout=10 --subscriptions linux

After the install of the Sensu agent, the agent registers itself to the Sensu platform and subscribes to the configured topic, and starts collecting metrics.

In this case the metric is keepalive

How to log in to the Sensu dashboard?

Browse to http://127.0.0.1:3000/dashboard

Sensu Subscriptions

  • Sensu backends “publish” service-based monitoring topics
  • Sensu agents “subscribe” to service-based monitoring topics
  • All monitoring configurations are managed via the control plane (Sensu backend REST API)
  • Sensu agents can be deployed at scale with minimal configuration

For more information go to Sensu website and Sensu Docs

(Visited 156 times, 1 visits today)

Leave A Comment