-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sudhanshu/5009 #5046
Closed
Closed
Sudhanshu/5009 #5046
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0cc92d0
initial
SudhanshuBawane e0695a2
error resolved but need polishing
SudhanshuBawane 90be109
inter
SudhanshuBawane 6fe811a
final
SudhanshuBawane 6a210ca
Final with signoff
SudhanshuBawane 926185c
clearing formatting
SudhanshuBawane 0e95059
formatting on comments
SudhanshuBawane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...bb2fd006d605a7a038b32269a22026d8947324f2bc0acdf35e8563cf4cb8660d7f/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic | ||
Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased | ||
|
||
## [0.2.2] - 2021-03-31 | ||
|
||
### Changed | ||
- Updated README | ||
|
||
## [0.2.1] - 2021-03-10 | ||
|
||
### Changed | ||
- Change release github action to use macos-latest so that macos cgo build works | ||
|
||
## [0.2.0] - 2021-03-10 | ||
|
||
### Changed | ||
- Updated goreleaser to build macOS version with cgo enabled | ||
|
||
## [0.1.0] - 2020-12-30 | ||
|
||
### Added | ||
- Initial release |
7 changes: 7 additions & 0 deletions
7
...ec3670c7b0a00fbbb2fd006d605a7a038b32269a22026d8947324f2bc0acdf35e8563cf4cb8660d7f/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2020 Todd Campbell | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you added this file by accident? |
||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
107 changes: 107 additions & 0 deletions
107
...0fbbb2fd006d605a7a038b32269a22026d8947324f2bc0acdf35e8563cf4cb8660d7f/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
[](https://bonsai.sensu.io/assets/sensu/check-cpu-usage) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you added this file by accident? |
||
 | ||
 | ||
|
||
# Sensu CPU usage check | ||
|
||
## Table of Contents | ||
- [Overview](#overview) | ||
- [Usage examples](#usage-examples) | ||
- [Configuration](#configuration) | ||
- [Asset registration](#asset-registration) | ||
- [Check definition](#check-definition) | ||
- [Installation from source](#installation-from-source) | ||
- [Contributing](#contributing) | ||
|
||
## Overview | ||
|
||
The Sensu CPU usage check is a [Sensu Check][1] that provides alerting and | ||
metrics for CPU usage. Metrics are provided in [nagios_perfdata][5] format. | ||
|
||
**Note:** The macOS binary is built using [cgo][6] and may not be portable | ||
across all versions of macOS. | ||
|
||
## Usage examples | ||
|
||
``` | ||
Check CPU usage and provide metrics | ||
|
||
Usage: | ||
check-cpu-usage [flags] | ||
check-cpu-usage [command] | ||
|
||
Available Commands: | ||
help Help about any command | ||
version Print the version number of this plugin | ||
|
||
Flags: | ||
-c, --critical float Critical threshold for overall CPU usage (default 90) | ||
-w, --warning float Warning threshold for overall CPU usage (default 75) | ||
-s, --sample-interval int Length of sample interval in seconds (default 2) | ||
-h, --help help for check-cpu-usage | ||
|
||
Use "check-cpu-usage [command] --help" for more information about a command. | ||
``` | ||
|
||
## Configuration | ||
|
||
### Asset registration | ||
|
||
[Sensu Assets][2] 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 with | ||
Sensu Backend 5.13 or later, you can use the following command to add the asset: | ||
|
||
``` | ||
sensuctl asset add sensu/check-cpu-usage | ||
``` | ||
|
||
If you're using an earlier version of sensuctl, you can find the asset on the | ||
[Bonsai Asset Index][3]. | ||
|
||
### Check definition | ||
|
||
```yml | ||
--- | ||
type: CheckConfig | ||
api_version: core/v2 | ||
metadata: | ||
name: check-cpu-usage | ||
namespace: default | ||
spec: | ||
command: >- | ||
check-cpu-usage | ||
--critical 95 | ||
--warning 85 | ||
--sample-interval 2 | ||
output_metric_format: nagios_perfdata | ||
output_metric_handlers: | ||
- influxdb | ||
subscriptions: | ||
- system | ||
runtime_assets: | ||
- sensu/check-cpu-usage | ||
``` | ||
|
||
## Installation from source | ||
|
||
The preferred way of installing and deploying this plugin is to use it as an | ||
Asset. If you would like to compile and install the plugin from source or | ||
contribute to it, download the latest version or create an executable from this | ||
source. | ||
|
||
From the local path of the check-cpu-usage repository: | ||
|
||
``` | ||
go build | ||
``` | ||
|
||
## Contributing | ||
|
||
For more information about contributing to this plugin, see [Contributing][4]. | ||
|
||
[1]: https://docs.sensu.io/sensu-go/latest/reference/checks/ | ||
[2]: https://docs.sensu.io/sensu-go/latest/reference/assets/ | ||
[3]: https://bonsai.sensu.io/assets/sensu/check-cpu-usage | ||
[4]: https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md | ||
[5]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-schedule/collect-metrics-with-checks/#supported-output-metric-formats | ||
[6]: https://golang.org/cmd/cgo/ |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you added this file by accident?