Skip to content

Instantly share code, notes, and snippets.

@piavlo
Created December 3, 2012 17:36
Show Gist options
  • Save piavlo/4196605 to your computer and use it in GitHub Desktop.
Save piavlo/4196605 to your computer and use it in GitHub Desktop.
sensu handler filter environment
diff --git a/lib/sensu/server.rb b/lib/sensu/server.rb
index 3d18f76..e63a399 100644
--- a/lib/sensu/server.rb
+++ b/lib/sensu/server.rb
@@ -173,6 +173,12 @@ module Sensu
:handler => handler
})
false
+ elsif event[:client].has_key?(:environment) && !handler.has_key?(:environments).include?(event[:client][:environment])
+ @logger.debug('handler does not handle #{event[:client][:environment]} environment', {
+ :event => event,
+ :handler => handler
+ })
+ false
elsif event[:action] == :resolve
true
elsif handler.has_key?(:severities) && !handler[:severities].include?(event_severity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment