https://github.com/sensu-plugins/sensu-plugins-uptime-checks
This plugin provides native instrumentation for collecting uptime and idletime metrics.
https://github.com/sensu-plugins/sensu-plugins-uptime-checks
sensu-plugins uptime uptime-monitor
Last synced: 7 months ago
JSON representation
This plugin provides native instrumentation for collecting uptime and idletime metrics.
- Host: GitHub
- URL: https://github.com/sensu-plugins/sensu-plugins-uptime-checks
- Owner: sensu-plugins
- License: mit
- Created: 2015-02-16T13:01:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T15:04:56.000Z (about 4 years ago)
- Last Synced: 2024-11-07T18:16:13.979Z (8 months ago)
- Topics: sensu-plugins, uptime, uptime-monitor
- Language: Ruby
- Homepage: http://sensu-plugins.io
- Size: 72.3 KB
- Stars: 3
- Watchers: 9
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-uptime-checks)
[ ](https://travis-ci.org/sensu-plugins/sensu-plugins-uptime-checks)
[](http://badge.fury.io/rb/sensu-plugins-uptime-checks)
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-uptime-checks)
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-uptime-checks)
[](https://gemnasium.com/sensu-plugins/sensu-plugins-uptime-checks)## Sensu Plugins Uptime Checks Plugin
- [Overview](#overview)
- [Files](#files)
- [Usage examples](#usage-examples)
- [Configuration](#configuration)
- [Sensu Go](#sensu-go)
- [Asset registration](#asset-registration)
- [Asset definition](#asset-definition)
- [Check definition](#check-definition)
- [Sensu Core](#sensu-core)
- [Check definition](#check-definition)
- [Installation from source](#installation-from-source)
- [Additional notes](#additional-notes)
- [Contributing](#contributing)### Overview
This plugin provides native instrumentation for collecting uptime and idletime metrics.
### Files
* bin/check-uptime.rb
* bin/metrics-uptime.rb
**check-uptime**
Checks the system's uptime and warns if the system has been rebooted.**metrics-uptime**
Provides uptime metrics.## Usage examples
### Help
**check-uptime.rb**
```
Usage: check-uptime.rb (options)
-g, --greater-than This compare uptime > threshold. Default behavior uptime < threshold
-w SEC Warn threshold in SEC
```**metrics-uptime.rb**
```
Usage: metrics-uptime.rb (options)
-s, --scheme SCHEME Metric naming scheme, text to prepend to metric
```## Configuration
### Sensu Go
#### Asset registrationAssets 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 sensu-plugins/sensu-plugins-uptime-checks`
If you're using an earlier version of sensuctl, you can download the asset definition from [this project's Bonsai asset index page](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-uptime-checks).
#### Asset definition
```yaml
---
type: Asset
api_version: core/v2
metadata:
name: sensu-plugins-uptime-checks
spec:
url: https://assets.bonsai.sensu.io/65a0f4378e92721cf5565e3be73bbe30632df6c7/sensu-plugins-uptime-checks_3.1.0_centos_linux_amd64.tar.gz
sha512: 2c0337391edfafa308c18bec7cae1c641012d6225c92d7bba98c79665e34311a2b13250a60b5b0074da82b274355e4715bca73c1b428b04132cd8152e39d120f
```#### Check definition
```yaml
---
type: CheckConfig
spec:
command: "check-uptime.rb"
handlers: []
high_flap_threshold: 0
interval: 10
low_flap_threshold: 0
publish: true
runtime_assets:
- sensu-plugins/sensu-plugins-uptime-checks
- sensu/sensu-ruby-runtime
subscriptions:
- linux
```### Sensu Core
#### Check definition
```json
{
"checks": {
"check-uptime": {
"command": "check-uptime.rb",
"subscribers": ["linux"],
"interval": 10,
"refresh": 10,
"handlers": ["influxdb"]
}
}
}
```## Installation from source
### Sensu Go
See the instructions above for [asset registration](#asset-registration).
### Sensu Core
Install and setup plugins on [Sensu Core](https://docs.sensu.io/sensu-core/latest/installation/installing-plugins/).
## Additional notes
### Sensu Go Ruby Runtime Assets
The Sensu assets packaged from this repository are built against the Sensu Ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator, or handler), make sure to include the corresponding [Sensu Ruby Runtime Asset](https://bonsai.sensu.io/assets/sensu/sensu-ruby-runtime) in the list of assets needed by the resource.
## Contributing
See [CONTRIBUTING.md](https://github.com/sensu-plugins/sensu-plugins-uptime-checks/blob/master/CONTRIBUTING.md) for information about contributing to this plugin.