License
MIT License
v0.1.1 · public · Published about 1 month ago
A Go port of sensu-plugins-uptime-checks, distributed as standalone binaries (no Ruby runtime required).
This plugin provides native instrumentation for collecting uptime and idle time metrics, and for alerting when a monitored system has recently rebooted.
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)
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
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.
---
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
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
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.
×