Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


README
Asset Definition
Release Notes
Release Assets

Sensu Bonsai Asset
Go Test
goreleaser

sensu-etcd-check

Table of Contents

Overview

The sensu-etcd-check is a Sensu Check that connects to one or more etcd cluster
endpoints and reports the database size reported by etcdctl endpoint status. The check goes
critical when the database size exceeds a configurable threshold, which is useful for catching
etcd clusters approaching their configured storage quota before they hit it and go read-only.

Usage examples

Usage:
  check-etcd [flags]

Flags:
  -c, --cert-file string       Path to the cert
  -h, --help                   help for check-etcd
  -k, --key-file string        Path to the key
  -s, --size int               Maximum database Size (default 1500000000)
  -t, --timeout int            Request timeout (default 5)
      --trusted-ca-file string Path to the CA file
  -u, --url strings            Url of etcd instance(s) (default [http://127.0.0.1:2379])
  • --url accepts a comma-separated list of endpoints; the check queries the status of the
    first URL in the list.
  • --size is the maximum acceptable DbSize in bytes before the check returns critical.
    Etcd's default storage quota is 2GB, so the default threshold here is set to 1.5GB to leave
    room to react.
  • --cert-file, --key-file, and --trusted-ca-file must all be provided together to enable
    mutual TLS when connecting to etcd.

Configuration

Asset registration

Sensu Assets are the best way to make use of this plugin. If you're not using an asset, please
consider doing so! If you're using sensuctl 5.13 with Sensu Backend 5.13 or later, you can use the
following command to add the asset:

sensuctl asset add elfranne/sensu-etcd-check

If you're using an earlier version of sensuctl, you can find the asset on the Bonsai Asset Index.

Check definition

---
type: CheckConfig
api_version: core/v2
metadata:
  name: sensu-etcd-check
  namespace: default
spec:
  command: sensu-etcd-check --url http://127.0.0.1:2379 --size 1500000000
  subscriptions:
  - etcd
  runtime_assets:
  - elfranne/sensu-etcd-check

A TLS-enabled example, for clusters using client certificate authentication:

---
type: CheckConfig
api_version: core/v2
metadata:
  name: sensu-etcd-check
  namespace: default
spec:
  command: >-
    sensu-etcd-check
    --url https://127.0.0.1:2379
    --cert-file /etc/etcd/ssl/etcd-client.crt
    --key-file /etc/etcd/ssl/etcd-client.key
    --trusted-ca-file /etc/etcd/ssl/ca.crt
  subscriptions:
  - etcd
  runtime_assets:
  - elfranne/sensu-etcd-check

Installation from source

The preferred way of installing and deploying this plugin is to use it as an Asset. If you would
like to compile and install the plugin from source or contribute to it, download the latest version
or create an executable script from this source.

From the local path of the sensu-etcd-check repository:

go build

Additional notes

The check only queries the status of the first endpoint in --url; additional endpoints are
passed through to the etcd client for connection purposes but are not each individually checked.

Contributing

For more information about contributing to this plugin, see Contributing.

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: