Configuring monitoring handlers
Configuring monitoring handlers
Handlers determine where the Sensu servers route monitoring events. For an overview of how the platform uses Sensu, see Sensu (monitoring).
Configuring alerts
The Sensu checks can be configured to send alerts to PagerDuty, Elasticsearch, or Slack. The configuration for these is in the Handlers Configuration hash on the Sensu Go Check Configurations property. You also have to specify the handler to use on each Sensu Go check in the Configurations for Sensu Go Checks hash.
Each check supports two kinds of handler assignments:
| Handler type |
Description |
| Event handlers |
Route the check's events to a destination. The available event handlers are pagerduty and elasticsearch_full_event_log. |
| Output metric handlers |
Route parsed metric data to a destination, for checks that produce metrics (such as CPU load, disk, and memory). The available output metric handler is elasticsearch_metric, used together with an output metric format of nagios_perfdata. |
PagerDuty handler
| Property |
Description |
| Token |
The PagerDuty security token. Use a different token per tenant; a global token should not be used. |
| Timeout |
The maximum duration, in seconds, to wait for the PagerDuty API to respond. The default value is 10. |
Elasticsearch handler
| Property |
Description |
| Username |
The Elasticsearch username. Only required if the Elasticsearch server has user/role management; otherwise it can be left empty. |
| Password |
The password for the Elasticsearch user. Only required if the Elasticsearch server has user/role management; otherwise it can be left empty. |
| URL |
The Elasticsearch endpoint. The scheme (http:// or https://) is not required. |
| Port |
The TCP port the Elasticsearch instance is listening on. The default value is 443. |
| TLS |
Turns HTTPS on or off for the connection to Elasticsearch. Turned on by default. |
| Event Index |
The Elasticsearch index in which all Sensu Go events are stored (used by the elasticsearch_full_event_log handler). |
| Metric Index |
The Elasticsearch index in which all parsed Sensu Go metrics are stored (used by the elasticsearch_metric handler). |
| Index with Timestamp field |
Turns on or off a timestamp appended to the event ID (dated index). Turned on by default. This is a global configuration, not a per-check option; all checks with the handler turned on are affected. |
Slack handler
| Property |
Description |
| Webhook URL |
The Slack webhook URL to send messages to. |
| Channel |
The Slack channel to post messages to. |
| User Name |
The username that messages are sent as. The default value is sensu. |
| Icon URL |
A URL to an image to use as the user avatar. The default is the Sensu logo. |
| Description Template |
The Slack notification output template, in Golang text/template format. The default value is {{ .Check.Output }}, the raw check output. |