Skip to content
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

handler-slack-multichannel.rb: several improvements #82

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Commits on Apr 10, 2019

  1. handler-slack-multichannel.rb: several improvements

    - Add support for single channel defined as a string rather than an array (removes the need of having 2 different handlers)
    - Implement a retry strategy for handling slack api transitient errors (like timeouts). Retries hardcoded to 5 with 10 second timeout, but we should make this a setting
    - Exits with non zero status on api call errors, to allow sensu-server to catch the output and log it
    - Deals with non-nagios standard exit codes for checks (0-3), also known as "out of bounds" errors
    	- Sets the color the same as UNKNOWN
    	- Displays the exit code as it was returned by the check, for detailed information
    kali-brandwatch committed Apr 10, 2019
    Configuration menu
    Copy the full SHA
    5f677d7 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2019

  1. Update bin/handler-slack-multichannel.rb

    Keep client and check names in the title
    
    Co-Authored-By: kali-brandwatch <[email protected]>
    majormoses and kali-brandwatch authored Apr 11, 2019
    Configuration menu
    Copy the full SHA
    3813622 View commit details
    Browse the repository at this point in the history
  2. Update bin/handler-slack-multichannel.rb

    Change to string interpolation
    
    Co-Authored-By: kali-brandwatch <[email protected]>
    majormoses and kali-brandwatch authored Apr 11, 2019
    Configuration menu
    Copy the full SHA
    77fdc90 View commit details
    Browse the repository at this point in the history
  3. Update bin/handler-slack-multichannel.rb

    Change to string interpolation
    
    Co-Authored-By: kali-brandwatch <[email protected]>
    majormoses and kali-brandwatch authored Apr 11, 2019
    Configuration menu
    Copy the full SHA
    8812aa4 View commit details
    Browse the repository at this point in the history
  4. Update bin/handler-slack-multichannel.rb

    Change to string interpolation
    
    Co-Authored-By: kali-brandwatch <[email protected]>
    majormoses and kali-brandwatch authored Apr 11, 2019
    Configuration menu
    Copy the full SHA
    5992ed0 View commit details
    Browse the repository at this point in the history
  5. Small fixes to handler-slack-multichannel.rb

    - Remove unnecessary puts for the whole request.
    - Fix syntax error on string interpolation.
    - Shorten error messages to keep clearer error messages and make rubocop happy about line length.
    kali-brandwatch committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    b0963fb View commit details
    Browse the repository at this point in the history
  6. handler-slack-multichannel.rb: add configurable override for non stan…

    …dard exit codes
    
    As discussed on sensu-plugins#82 (comment) and sensu-plugins#82 (comment)
    Add a configurable setting for which exit status code will be used when the check returns a non standard status (non [0..3]), defaulting to 3 (UNK)
    Set rescues on `color` and `translate_status` to use this setting.
    Should resolve both comments above
    kali-brandwatch committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    fac988a View commit details
    Browse the repository at this point in the history