Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


v0.0.9 · public · Published over 3 years ago

README
Asset Definition
Release Notes
Release Assets

Sensu Go Handler Event KeepAlive By TTL

Go Test
Sensu Bonsai Asset

The Sensu Go Handler Event KeepAlive By TTL is a Sensu Event Handler which manages
Sensu Events Generede by ad hoc Checks that still alerting after TTL expired as message log "level":"warning","msg":"check TTL expired" and "output": "Last check execution was xX seconds ago" .The purposes of handler is Sensu remove that events after number of occurrences trigged.

Installation

Download the latest version of the sensu-event-keepalive-ttl-handler from releases,
or create an executable script from this source.

From the local path of the sensu-event-keepalive-ttl-handler repository:

go build -o /usr/local/bin/sensu-event-keepalive-ttl-handler main.go

Configuration

Example Sensu Go handler definition:

type: Handler
api_version: core/v2
metadata:
  name: event-keepalive-ttl-handler
  namespace: default
spec:
  type: pipe
  command: sensu-event-keepalive-ttl-handler -k APYKEY -h http://localhost:8080 -m 10
  env_vars:
  - API_JEY=""
  - SENSU_MAX_OCCURRENCE=10
  - SENSU_URL=http://localhost:8080
  timeout: 10
  runtime_assets:
  - jefferson22alcantara/sensu-event-keepalive-ttl-handler
  filters:
  - is_incident

Example Sensu Go check definition:

---
type: CheckConfig
api_version: core/v2
metadata:
  name: dummy-app-healthz
  namespace: default
  annotations:
    sensu.io/plugins/sensu-event-keepalive-ttl-handler/conf/enable: "true"
spec:
  command: check-http -u http://localhost:8080/healthz
  subscriptions:
  - dummy
  handlers:
  - event-keepalive-ttl-handler
  interval: 60
  publish: true

Usage Examples

Help:



The Sensu Go Remove events as keepalive

Usage:
  sensu-event-keepalive-ttl-handler [flags]
  sensu-event-keepalive-ttl-handler [command]

Available Commands:
  help        Help about any command
  version     Print the version number of this plugin

Flags:
  -k, --apikey string        The Sensu Api Key , use default from API_JEY env var
  -h, --help                 help for sensu-event-keepalive-ttl-handler
  -m, --max_occurrence int   The Max event Occurence after ttl to remove event   , use default from SENSU_MAX_OCCURRENCE env var
  -u, --sensu_url string     The Sensu Api URL  , use default from SENSU_URL env var

Use "sensu-event-keepalive-ttl-handler [command] --help" for more information about a co

Note: Make sure to set the "sensu.io/plugins/sensu-event-keepalive-ttl-handler/conf/enable": "true", annotaition on checks.

Argument Annotations

All arguments for this handler are tunable on a per entity or check basis based on annotations. The
annotations keyspace for this handler is "sensu.io/plugins/sensu-event-keepalive-ttl-handler/conf/enable": "true",.

Examples

To change the team argument for a particular check, for that checks's metadata add the following:

type: CheckConfig
api_version: core/v2
metadata:
  annotations:
    sensu.io/plugins/sensu-event-keepalive-ttl-handler/conf/enable: "true"
[...]

Asset creation

The easiest way to get this handler added to your Sensu environment, is to add it as an asset from Bonsai:

sensuctl asset add jefferson22alcantara/sensu-event-keepalive-ttl-handler

See sensuctl asset --help for details on how to specify version.

Contributing

See https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md

Are you sure you want to report this asset?

Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.

×

You must be signed in to report this asset.

Sign In with Github

Download

×

Either download the source code:

Download Source

Or download the asset definition: