Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


v0.1.1 · public · Published 25 days ago

README
Asset Definition
Release Notes
Release Assets

Sensu Bonsai Asset
Go Test
Go Lint

sensu-check-uptime

A Go port of sensu-plugins-uptime-checks, distributed as standalone binaries (no Ruby runtime required).

Overview

This plugin provides native instrumentation for collecting uptime and idle time metrics, and for alerting when a monitored system has recently rebooted.

Commands

check-uptime

Checks the system's uptime and warns if the system has recently rebooted. Supported on Linux and Windows.

Usage:
  check-uptime [flags]

Flags:
  -g, --greater-than         Compare uptime > threshold. Default behavior is uptime < threshold
  -w, --warn int              Warn threshold in seconds (default 180)

metrics-uptime

Outputs uptime and idle time metrics read from /proc/uptime, in the Graphite plaintext protocol (path value timestamp). Linux only, matching the scope of the original Ruby plugin.

Usage:
  metrics-uptime [flags]

Flags:
  -s, --scheme string   Metric naming scheme, text to prepend to metric (default "<hostname>.uptime")

Example output:

myhost.uptime.uptime 123456 1700000000
myhost.uptime.idletime 654321 1700000000

Configuration

Asset registration

Assets are the best way to make use of this plugin. If you're using sensuctl 5.13 or later, you can use the following command to add the asset:

sensuctl asset add nmollerup/sensu-check-uptime

If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai asset index page.

Check definition

---
type: CheckConfig
api_version: core/v2
metadata:
  name: check-uptime
spec:
  command: "check-uptime -w 180"
  handlers: []
  high_flap_threshold: 0
  interval: 10
  low_flap_threshold: 0
  publish: true
  runtime_assets:
  - nmollerup/sensu-check-uptime
  subscriptions:
  - linux
---
type: CheckConfig
api_version: core/v2
metadata:
  name: metrics-uptime
spec:
  command: "metrics-uptime"
  handlers:
  - influxdb
  high_flap_threshold: 0
  interval: 60
  low_flap_threshold: 0
  publish: true
  runtime_assets:
  - nmollerup/sensu-check-uptime
  subscriptions:
  - linux
  output_metric_format: graphite_plaintext
  output_metric_handlers:
  - influxdb

Installation from source

Download the latest release binaries from the releases page, or build from source:

go build -o bin/check-uptime ./cmd/check-uptime
go build -o bin/metrics-uptime ./cmd/metrics-uptime

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: