License
MIT License
v0.0.2 · public · Published over 5 years ago
This plugin provides a check for system uptime for Sensu Go. The sensu-go-cpu-check
check takes the flags -w
(warning) and -c
(critical) and a desired duration utilization percentage after each flag. By default, these are a warning value of 75% and a critical value of 90%.
While it's generally recommended to use an asset, you can 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-cpu-check repository:
sensu-go-cpu-check
go build -o /usr/local/bin/sensu-go-cpu-check main.go
Assets are the best way to make use of this check. If you're not using an asset, please consider doing so! You can find this asset on the Bonsai Asset Index.
You can download the asset definition there, or you can do a little bit of copy/pasta and use the one below:
---
type: Asset
api_version: core/v2
metadata:
name: sensu-go-cpu-check
namespace: CHANGEME
labels: {}
annotations: {}
spec:
url: https://github.com/asachs01/sensu-go-cpu-check/releases/download/0.0.1/sensu-go-cpu-check_0.0.1_linux_amd64.tar.gz
sha512:
filters:
- entity.system.os == 'linux'
- entity.system.arch == 'amd64'
NOTE: PLEASE ENSURE YOU UPDATE YOUR URL AND SHA512 BEFORE USING THE ASSET. If you don't, you might just be stuck on a super old version. Don't say I didn't warn you ¯\(ツ)/¯
Example Sensu Go definition:
sensu-go-cpu-check
type: CheckConfig
api_version: core/v2
metadata:
name: sensu-go-cpu-check
namespace: CHANGEME
spec:
command: sensu-go-cpu-check -w 80 -c 95
runtime_assets:
- sensu-go-cpu-check
interval: 60
publish: true
output_metric_format: nagios_perfdata
output_metric_handlers:
- infuxdb
handlers:
- slack
subscriptions:
- system
The Sensu Go check for system CPU usage
Usage:
sensu-go-cpu-check [flags]
Flags:
-c, --critical string Critical value for system cpu (default "90")
-h, --help help for sensu-go-cpu-check
-w, --warning string Warning value for system cpu. (default "75")
This project uses gopsutil
, and is thus largely dependent on the systems that it supports. For this plugin, the following operating systems are supported:
See https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md
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.
×