This lesson covers another one of Sensu's building blocks: Handlers. Handlers are designed to take some sort of action on the event data generated by checks. Handlers typically fall into one of several categories:
- Alerting handlers (notify a human that something needs to happen)
- Metric handlers (take metric data and ship it off to another application for storage & further processing)
- Configuration handlers (use event data to communicate with an external source of truth)
Let's start by taking a look at an example alerting handler configuration for Slack.
api_version: core/v2 type: Handler metadata: namespace: default name: slack spec: type: pipe runtime_assets: - slack-handler command: sensu-slack-handler --channel '#demo' --timeout 20 --username 'sensu' --webhook-url 'https://hooks.slack.com/services/XXXXXXXX/XXXXXXXXXX/XXXXXXXXXXXX timeout: 30 filters: - is_incident - not_silenced
There's quite a bit going on here, but the pattern should feel familiar and reminiscent of what you saw in the example check configuration.
Let's continue on and dissect what we have here.