lib/sensu/extensions/check-deps.rb
# Check to see if an event exists for a subscription/check pair. This
# method is looking for a HTTP response code of `200`.
#
# @param subscription_name [String]
# @param check_name [String]
# @return [Boolean]
Check to see if an event exists for a subscription/check pair. This
method is looking for a HTTP response code of `200`.
Check to see if an event exists for a subscription / check pair . This method is looking for a HTTP response code of ` 200 ` .
def subscription_event_exists?(subscription_name, check_name)
              path = "/events"
              response = sensu_api_get_request(path)
              events = JSON.load(response.body)
              !events.select { |event| event[:client][:subscriptions].include?(subscription_name) && event[:check][:name] == check_name}.empty?
            end
def subscription_event_exists? ( subscription_name , check_name ) path = "/events" response = sensu_api_get_request ( path ) events = JSON . load ( response . body ) ! events . select { | event | event [ :client ] [ :subscriptions ] . include? ( subscription_name ) && event [ :check ] [ :name ] == check_name } . empty? end
Check to see if an event exists for a subscription/check pair.
Check to see if an event exists for a subscription / check pair .
None
Boolean
subscription_name
<not_specific>
check_name
<not_specific>
<not_specific>
None