-
Notifications
You must be signed in to change notification settings - Fork 37
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
contact based routing only accepts 1 email address - same as #55 #58
Comments
@stevenviola another report of this, if we can't get this working we will have to revert the change. |
Hey @njomeara, in |
I don't honestly see the value in having |
@majormoses I was emulating the syntax in the sensu reference guide for checks and clients. Both If we want to keep the compatibility with Sensu Enterprise, I could document the difference between |
Ya it makes total sense to me and I feel the same way about that with handler vs handlers in check definitions. All it does is add confusion. I think we could catch this scenario and throw an |
@stevenviola I just opened a PR to help users with this type of misconfiguration as it is a fairly easy to trap. Once it has been reviewed, merged, and released we can have the user test and see if it catches their scenario and tells them how to update it. If that goes well and this works as expected hopefully we can put this to rest. |
@njomeara can you please try using 2.0.0 which I just released to attempt to catch this misconfiguration? |
@majormoses @stevenviola, I updated the sensu-plugins-mailer to 2.0.0 and tried again with this config in the check ... Thank you for your support |
@njomeara did you see anything in your server logs that would have indicated that there was an issue? The goal was to make it easier to spot the issue rather than merge the two. I added this: https://github.com/sensu-plugins/sensu-plugins-mailer/blob/2.0.0/bin/handler-mailer.rb#L148-L153 we should probably add a "Gotcha" in the readme to warn users about this behavior. |
@majormoses. Debug logs below. First run with "contact" and second run with "contacts". don't see anything in server.log (api.log had nothing either). Note the send run with "contacts" sent to two email addresses but the first run with "contact" only sent to one address
|
So the second one is working just fine, what is confusing me here is that you are not triggering this: https://github.com/sensu-plugins/sensu-plugins-mailer/blob/2.0.0/bin/handler-mailer.rb#L148-L153 on the first one. |
OK I think I figured it out thanks to @cwjohnston who helped me realize whats going on. As you are specifying it from the check as |
@njomeara can you try pulling that handler in and seeing if we can trigger something to help user to properly configure. |
Now it looks like mail is not sent at all when "contact" is used [root@ieatoskca-sensu3 bin]# echo '{ "name": "dodgy_check", "output": "testing email alerts", "status": 0, "handler": "mailer","contact":["support","support"] }' > /dev/tcp/localhost/3030 [root@ieatoskca-sensu3 ~]# tail -f /var/log/sensu/sensu-server.log | grep dodgy Changing to "contacts" [root@ieatoskca-sensu3 bin]# echo '{ "name": "dodgy_check", "output": "testing email alerts", "status": 1, "handler": "mailer","contacts":["support","support"] }' > /dev/tcp/localhost/3030 [root@ieatoskca-sensu3 ~]# tail -f /var/log/sensu/sensu-server.log | grep dodgy i checked my handler-mailer.rb below to make sure it had the code change .. [root@ieatoskca-sensu3 bin]# grep src /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-mailer-2.0.0/bin/handler-mailer.rb |
Well that is progress I guess, that means we have successfully trapped the scenario. The thing that does not make sense is that there is not a log messaging indicating what is happening. @cwjohnston any thoughts? |
Hi,
I have the same problem as reported in ..
contact based routing only accepts 1 email address #55
The email contacts are configured in the check. Emails only get sent to the default address configured in the mymail_handler.json file and not to the contacts configured in the support.json file.
If i only put one address in "contact" field in the check it will send to that address, adding an array of addresses doesn't work.
mymail_handler.json
support.json
check_test.json
I turned on debug and attached the output of:
Sensu was running on version
0.29
. I updated to latest as below with same result...Regards,
Noel
The text was updated successfully, but these errors were encountered: