Sensu Go Uptime Check Plugin
Overview
This plugin provides a check for system uptime for Sensu Go. The sensu-go-uptime-check
check takes the flags -w
(warning) and -c
(critical) and a time duration after each flag (e.g. 24h). The time values can be represented in seconds (s), minutes (m), or hours (h). The plugin uses a default warning value of 72h and a default critical value of 168h (1 week).
Files
N/A
Usage examples
Help
The Sensu Go check for system uptime
Usage:
sensu-go-uptime-check [flags]
Flags:
-w, --warning (time in s,m,h) Warning value in seconds, minutes, or hours, default is 72 hours (72h)
-c, --critical (time in s,m,h) Warning value in seconds, minutes, or hours default is 1 week (168h)
-h, --help help for sensu-go-uptime-status
Configuration
Sensu Go
Asset registration
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 or later, you can use the following command to add the asset:
sensuctl asset add asachs01/sensu-go-uptime-check
If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai asset index page, download a copy of the handler plugin from releases, or create an executable script from this source.
From the local path of the sensu-go-uptime-check repository:
go build -o /usr/local/bin/sensu-go-uptime-check main.go
Asset definition
---
type: Asset
api_version: core/v2
metadata:
name: sensu-go-uptime-check
spec:
url: https://assets.bonsai.sensu.io/1f967e65880ead0b4bfe13e331b3fc6f26ebfed2/sensu-go-uptime-check_1.0.1_linux_amd64.tar.gz
sha512: 3d732f21611bb03dddc529c46b1bffd2b97f2a5b5ae7a935964a179adb26d5ccffa3ffaf0662380be4485d6d5e4295b0812ef1d22919e02ebb412c4eef1aff24
NOTE: Make sure to update the URL and SHA512 before you use the asset. If you don't, you might be using an older version.
Handler definition
type: CheckConfig
api_version: core/v2
metadata:
name: sensu-go-uptime-check
namespace: CHANGEME
spec:
command: sensu-go-uptime-check
runtime_assets:
- sensu-go-uptime-check
interval: 60
publish: true
output_metric_format: nagios_perfdata
output_metric_handlers:
- infuxdb
handlers:
- slack
subscriptions:
- system
Sensu Core
N/A
Installation from source
Sensu Go
See the instructions above for asset registration.
Sensu Core
Install and setup plugins on Sensu Core.
Additional notes
Example output
Contributing
See the Sensu Go repository CONTRIBUTING.md for information about contributing to this plugin.