Comments (6)
@fguimond @calebhailey I don't have access to this repository https://github.com/sensu-skunkworks/sensu-aws-ec2-deregistration-handler. Please provide me the access.
from sensu-plugin-sdk.
@sreejita-biswas - You can use this gist. Should be the same line numbers.
https://gist.github.com/fguimond/c4bfad1b6b6fe7165cdb4c028f4ecb73
from sensu-plugin-sdk.
@sreejita-biswas invite sent; see: https://github.com/sensu-skunkworks/sensu-aws-ec2-deregistration-handler/invitations
from sensu-plugin-sdk.
@fguimond please note the following comments/responses to your issue description:
-
"Handlers read a Sensu Event from stdin while Checks don't"
Checks do not read stdin by default, but this is supported via the
stdin
check definition attribute; see https://docs.sensu.io/sensu-go/5.5/reference/checks/#spec-attributes (under "stdin"). Please note the following comments from the documentation:If the Sensu agent writes JSON serialized Sensu entity and check data to the command process’ STDIN. The command must expect the JSON data via STDIN, read it, and close STDIN. This attribute cannot be used with existing Sensu check plugins, nor Nagios plugins etc, as Sensu agent will wait indefinitely for the check process to read and close STDIN.
-
"Handlers can read input values from the event, while checks can't since they don't read an event"
I'm not sure if I understand this assertion. Checks can read input values from the request payload if
stdin
is enabled, however, only the check configuration is available at this time (e.g. the configured check definition attributes). -
"Checks write the return the result data to stdout or stderr, handlers don't"
Handlers can and do generate standard output (stdout), and Sensu does consume this output, but handler stdout is currently only visible in the
sensu-backend
logs, and only when--log-level
is set todebug
(we don't currently display this anywhere in the web ui, however this will change soon). -
"Checks exit status code indicates the state... 0=OK, 1=WARNING, 2=CRITICAL, other=UNKNOWN"
Sensu also validates handler exit status codes to determine handler success; if a handler exits with a "non-zero" exit status code, Sensu logs an error. As above, this is currently only observable in the sensu-backend logs and only when
--log-level
is set todebug
.
I hope this helps! Let me know if you have any questions.
from sensu-plugin-sdk.
Thank you for the clarifications @calebhailey this is very helpful.
- "If the Sensu agent writes JSON serialized Sensu entity and check data to the command process’ STDIN"
Would you happen to have a sample of such a structure? The Event
consumed by the handler does contain a Check
and an Entity
but it also has Timestamp
and Metrics
. Is there a different data structure used for checks?
Thank you!
from sensu-plugin-sdk.
from sensu-plugin-sdk.
Related Issues (20)
- Bump api/core/v2 version to 2.3.0 HOT 1
- Add a template helper for converting slice of bytes to UUID representation
- Feature Enhancement: add sprig for enhanced template functions HOT 1
- support downcased annotations
- Imports with old name on v0.13.0 bug HOT 1
- Feature Request: Function to add keyspace describe command for plugins
- HTTP Client POST not working as intended HOT 1
- Feature Request: Extend argument parsing support for pflags.StringArray HOT 1
- Bug: Annotation overrides for StringSlice arguments are not treated as space delimited like cmdline and env var. HOT 1
- Feature Enhancement: Do not trigger usage message for errors in all cases
- Feature Enhancement: extend base plugin cmd to describe environment variable to argument mappings HOT 1
- Add AWS SDK helpers to the SDK HOT 1
- Add tests for AWS common helpers HOT 1
- Add support/helpers for generating plugins with subcommands
- Feature Enhancement: Include helper functions for handling of prometheus exposition formatted metrics HOT 3
- Feature Request: Impliment state file functionality in SDK HOT 3
- Update Readme with new Options syntax example
- bad argument parsing not throwing an error with SDK v0.16
- How to keep a state between two handler's executions? HOT 1
- Migrate to new Sensu core api and types packages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sensu-plugin-sdk.