Sensu Integration
The ilert Sensu Integration helps you to publish alerts into your channels or resolve alerts.
Last updated
The ilert Sensu Integration helps you to publish alerts into your channels or resolve alerts.
Last updated
(c) 2011 - 2024 ilert GmbH
Sensu is a tool that functions as an observability pipeline which delivers monitoring as code on any cloud.
Go to Alert sources --> Alert sources and click on Create new alert source
Search for Sensu in the search field, click on the Sensu tile and click on Next.
Give your alert source a name, optionally assign teams and click Next.
Select an escalation policy by creating a new one or assigning an existing one.
Select you Alert grouping preference and click Continue setup. You may click Do not group alerts for now and change it later.
The next page show additional settings such as customer alert templates or notification prioritiy. Click on Finish setup for now.
On the final page, an API key and / or webhook URL will be generated that you will need later in this guide.
Add Sensu ilert Handler
Make sure that the asset was added to your Sensu backend. Run:
In the following command, replace <ilert_key> with your ilert API key.
Then run the updated command:
Make sure that your handler was added by retrieving the complete handler definition in YAML or JSON format:
Trigger an event. You can try it with the file_exists check and an ilert handler workflow in place - remove a file to cause Sensu to send a non-OK event.
You can refer to the next section for more instructions.
Find your entity name:
The ID
in the response is the name of your entity and replace <entity_name>
with the name of your entity in the sensuctl
command below. Then run the command to add the system
subscription to your entity:
For Entity Class
, press enter.
For Subscriptions
, type system
and press enter.
Confirm both sensu-backend
and sensu-agent
are running. You can use docker ps
if you are running both from docker.
file_exists
checkBefore you can add the check, you need to add the Nagios Foundation asset to your Sensu configuration:
To confirm that the asset was added to your Sensu backend, run:
The check command includes the path for the file that the check will look for on your system, /tmp/my-file.txt
. For this guide, you’ll add /tmp/my-file.txt
as a temporary file:
You should see === ncr-devops-platform/nagiosfoundation
followed by a list of available builds for the asset. Now that you’ve added the Nagios Foundation dynamic runtime asset, you can add its file_exists
check to your Sensu backend. Use sensuctl to add the check:
To confirm that the check was added to your Sensu backend and view the check definition in YAML or JSON format,
file_exists
checkRemove the file /tmp/my-file.txt
:
This will make sure the file is not there for Sensu to find the next time the file_exists
check runs. After about 10 seconds, Sensu will detect that my-file.txt
is missing and reflect that in an event. To view the event with sensuctl
, run:
The response should show that the file removal resulted in a CRITICAL (2) event:
Open the Sensu web UI to see the events the file_exists
check is generating. Visit http://127.0.0.1:3000, and log in as the admin user (created during initialization when you installed the Sensu backend). The failing check’s events will be listed on the Events page.
The Alert should be created on the Sensu Alert Source on ilert's side as well
To complete your workflow, restore the file that you removed so Sensu sends a resolution to ilert: