lib/sensu/server/handle.rb
def handler_extension(handler, event_data, event_id)
        handler.safe_run(event_data) do |output, status|
          log_level = (output.empty? && status.zero?) ? :debug : :info
          @logger.send(log_level, "handler extension output", {
            :extension => handler.definition,
            :event => {
              :id => event_id
            },
            :output => output,
            :status => status
          })
          @in_progress[:events] -= 1 if @in_progress
        end
      end
# Run a handler extension, within the Sensu EventMachine reactor
# (event loop). The extension API `safe_run()` method is used to
# guard against most errors. The `safe_run()` callback is always
# called, logging the extension run output and status, and
# decrementing the `@in_progress[:events]` by `1`.
#
# @param handler [Hash] definition.
# @param event_data [Object] to pass to the handler extension.
# @param event_id [String] event UUID
Run a handler extension, within the Sensu EventMachine reactor
(event loop). The extension API `safe_run()` method is used to
guard against most errors.
Run a handler extension within the Sensu EventMachine reactor ( event loop ) . The extension API ` safe_run () ` method is used to guard against most errors .
def handler_extension(handler, event_data, event_id)
        handler.safe_run(event_data) do |output, status|
          log_level = (output.empty? && status.zero?) ? :debug : :info
          @logger.send(log_level, "handler extension output", {
            :extension => handler.definition,
            :event => {
              :id => event_id
            },
            :output => output,
            :status => status
          })
          @in_progress[:events] -= 1 if @in_progress
        end
      end
def handler_extension ( handler , event_data , event_id ) handler . safe_run ( event_data ) do | output , status | log_level = ( output . empty? && status . zero? ) ? :debug : :info @logger . send ( log_level , "handler extension output" , { :extension => handler . definition , :event => { :id => event_id } , :output => output , :status => status } ) @in_progress [ :events ] -= 1 if @in_progress end end
Run a handler extension, within the Sensu EventMachine reactor
(event loop).
Run a handler extension within the Sensu EventMachine reactor ( event loop ) .
handler
None
event_data
to pass to the handler extension.
to pass to the handler extension .
event_id
None