Giter Club home page Giter Club logo

Comments (6)

sreejita-biswas avatar sreejita-biswas commented on September 29, 2024

@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.

fguimond avatar fguimond commented on September 29, 2024

@sreejita-biswas - You can use this gist. Should be the same line numbers.
https://gist.github.com/fguimond/c4bfad1b6b6fe7165cdb4c028f4ecb73

from sensu-plugin-sdk.

calebhailey avatar calebhailey commented on September 29, 2024

@sreejita-biswas invite sent; see: https://github.com/sensu-skunkworks/sensu-aws-ec2-deregistration-handler/invitations

from sensu-plugin-sdk.

calebhailey avatar calebhailey commented on September 29, 2024

@fguimond please note the following comments/responses to your issue description:

  1. "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.

  2. "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).

  3. "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 to debug (we don't currently display this anywhere in the web ui, however this will change soon).

  4. "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 to debug.

I hope this helps! Let me know if you have any questions.

from sensu-plugin-sdk.

fguimond avatar fguimond commented on September 29, 2024

Thank you for the clarifications @calebhailey this is very helpful.

  1. "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.

fguimond avatar fguimond commented on September 29, 2024

Sensu Go Plugin Library

from sensu-plugin-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.