I’m trying to work out how the best way to have events sent to different addresses depending on where they originated.
I’m using the community mailer, at the moment, and attaching a configuration hash that specifies “mail_to” and all the other configuration options.
For a set of checks that are all the same, except they originate from machines in different environments, I want to change the “mail_to” config for the mailer handler to go to a different notification list.
Is there a way you can think of to do this in the sensu config json?
I’m guessing as a last resort I can hack the mailer.rb to examine the machine’s environment and change the mail_to there, but it’s not very Sensu.