|
| 1 | +[](https://bonsai.sensu.io/assets/elfranne/sensu-top-process) |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +# Check Plugin Template |
| 6 | + |
| 7 | +## Overview |
| 8 | +check-plugin-template is a template repository which wraps the [Sensu Plugin SDK][2]. |
| 9 | +To use this project as a template, click the "Use this template" button from the main project page. |
| 10 | +Once the repository is created from this template, you can use the [Sensu Plugin Tool][9] to |
| 11 | +populate the templated fields with the proper values. |
| 12 | + |
| 13 | +## Functionality |
| 14 | + |
| 15 | +After successfully creating a project from this template, update the `Config` struct with any |
| 16 | +configuration options for the plugin, map those values as plugin options in the variable `options`, |
| 17 | +and customize the `checkArgs` and `executeCheck` functions in [main.go][7]. |
| 18 | + |
| 19 | +When writing or updating a plugin's README from this template, review the Sensu Community |
| 20 | +[plugin README style guide][3] for content suggestions and guidance. Remove everything |
| 21 | +prior to `# sensu-top-process` from the generated README file, and add additional context about the |
| 22 | +plugin per the style guide. |
| 23 | + |
| 24 | +## Releases with Github Actions |
| 25 | + |
| 26 | +To release a version of your project, simply tag the target sha with a semver release without a `v` |
| 27 | +prefix (ex. `1.0.0`). This will trigger the [GitHub action][5] workflow to [build and release][4] |
| 28 | +the plugin with goreleaser. Register the asset with [Bonsai][8] to share it with the community! |
| 29 | + |
| 30 | +*** |
| 31 | + |
| 32 | +# sensu-top-process |
| 33 | + |
| 34 | +## Table of Contents |
| 35 | +- [Overview](#overview) |
| 36 | +- [Files](#files) |
| 37 | +- [Usage examples](#usage-examples) |
| 38 | +- [Configuration](#configuration) |
| 39 | + - [Asset registration](#asset-registration) |
| 40 | + - [Check definition](#check-definition) |
| 41 | +- [Installation from source](#installation-from-source) |
| 42 | +- [Additional notes](#additional-notes) |
| 43 | +- [Contributing](#contributing) |
| 44 | + |
| 45 | +## Overview |
| 46 | + |
| 47 | +The sensu-top-process is a [Sensu Check][6] that ... |
| 48 | + |
| 49 | +## Files |
| 50 | + |
| 51 | +## Usage examples |
| 52 | + |
| 53 | +## Configuration |
| 54 | + |
| 55 | +### Asset registration |
| 56 | + |
| 57 | +[Sensu Assets][10] are the best way to make use of this plugin. If you're not using an asset, please |
| 58 | +consider doing so! If you're using sensuctl 5.13 with Sensu Backend 5.13 or later, you can use the |
| 59 | +following command to add the asset: |
| 60 | + |
| 61 | +``` |
| 62 | +sensuctl asset add elfranne/sensu-top-process |
| 63 | +``` |
| 64 | + |
| 65 | +If you're using an earlier version of sensuctl, you can find the asset on the [Bonsai Asset Index][https://bonsai.sensu.io/assets/elfranne/sensu-top-process]. |
| 66 | + |
| 67 | +### Check definition |
| 68 | + |
| 69 | +```yml |
| 70 | +--- |
| 71 | +type: CheckConfig |
| 72 | +api_version: core/v2 |
| 73 | +metadata: |
| 74 | + name: sensu-top-process |
| 75 | + namespace: default |
| 76 | +spec: |
| 77 | + command: sensu-top-process --example example_arg |
| 78 | + subscriptions: |
| 79 | + - system |
| 80 | + runtime_assets: |
| 81 | + - elfranne/sensu-top-process |
| 82 | +``` |
| 83 | +
|
| 84 | +## Installation from source |
| 85 | +
|
| 86 | +The preferred way of installing and deploying this plugin is to use it as an Asset. If you would |
| 87 | +like to compile and install the plugin from source or contribute to it, download the latest version |
| 88 | +or create an executable script from this source. |
| 89 | +
|
| 90 | +From the local path of the sensu-top-process repository: |
| 91 | +
|
| 92 | +``` |
| 93 | +go build |
| 94 | +``` |
| 95 | + |
| 96 | +## Additional notes |
| 97 | + |
| 98 | +## Contributing |
| 99 | + |
| 100 | +For more information about contributing to this plugin, see [Contributing][1]. |
| 101 | + |
| 102 | +[1]: https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md |
| 103 | +[2]: https://github.com/sensu/sensu-plugin-sdk |
| 104 | +[3]: https://github.com/sensu-plugins/community/blob/master/PLUGIN_STYLEGUIDE.md |
| 105 | +[4]: https://github.com/elfranne/sensu-top-process/blob/master/.github/workflows/release.yml |
| 106 | +[5]: https://github.com/elfranne/sensu-top-process/actions |
| 107 | +[6]: https://docs.sensu.io/sensu-go/latest/reference/checks/ |
| 108 | +[7]: https://github.com/sensu/check-plugin-template/blob/master/main.go |
| 109 | +[8]: https://bonsai.sensu.io/ |
| 110 | +[9]: https://github.com/sensu/sensu-plugin-tool |
| 111 | +[10]: https://docs.sensu.io/sensu-go/latest/reference/assets/ |
0 commit comments