Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.
Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.
Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.
The documentation embedded into the source for the handler-slack-multichannel is a bit sparse. Any ideas on how one would define the various channels? For the basic slack module, one has to define a webhook_url. Presumably, with the multichannel plugin, one would have a list of webhook_urls to define for the various channels (default, compulsory, etc). I’ve tried a few variations on my own, but to no avail. Any guidance would be most appreciated!
···
On Wednesday, February 22, 2017 at 11:48:08 PM UTC-5, Kyle Anderson wrote:
All the json files in conf.d get merged together, so there is only one “slack”: configuration hash manifesting.
You will probably have to do something that understands multi-channel more natively
Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.
All alerts by default go to alerts, in cases where I want to report to some other channel I include the channel name in the json of the check, for example:
and this way I am able to get alerts sent to various channels, my requirement was to send the alert to any one of the channels depending on the check and this solution works for that case.
I hope this helps.
Thanks
···
On Thursday, April 20, 2017 at 5:21:21 AM UTC-7, David R wrote:
The documentation embedded into the source for the handler-slack-multichannel is a bit sparse. Any ideas on how one would define the various channels? For the basic slack module, one has to define a webhook_url. Presumably, with the multichannel plugin, one would have a list of webhook_urls to define for the various channels (default, compulsory, etc). I’ve tried a few variations on my own, but to no avail. Any guidance would be most appreciated!
On Wednesday, February 22, 2017 at 11:48:08 PM UTC-5, Kyle Anderson wrote:
All the json files in conf.d get merged together, so there is only one “slack”: configuration hash manifesting.
You will probably have to do something that understands multi-channel more natively
Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.
All alerts by default go to alerts, in cases where I want to report to some other channel I include the channel name in the json of the check, for example:
and this way I am able to get alerts sent to various channels, my requirement was to send the alert to any one of the channels depending on the check and this solution works for that case.
I hope this helps.
Thanks
On Thursday, April 20, 2017 at 5:21:21 AM UTC-7, David R wrote:
The documentation embedded into the source for the handler-slack-multichannel is a bit sparse. Any ideas on how one would define the various channels? For the basic slack module, one has to define a webhook_url. Presumably, with the multichannel plugin, one would have a list of webhook_urls to define for the various channels (default, compulsory, etc). I’ve tried a few variations on my own, but to no avail. Any guidance would be most appreciated!
On Wednesday, February 22, 2017 at 11:48:08 PM UTC-5, Kyle Anderson wrote:
All the json files in conf.d get merged together, so there is only one “slack”: configuration hash manifesting.
You will probably have to do something that understands multi-channel more natively
Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.
I was still running into an issue as we have a proxy, but your example really helped me to find the solution, and I wanted to share it here.
For those using a proxy and wanting to use handler-slack-multichannel.rb, know that the setting/option for proxy_address is NOT the same in handler-slack-multichannel.rb as in handler-slack.rb.
The handler-slack.rb file uses/expects proxy_address to be passed as setting/parameter in ones slack handler configuration. Whereas handler-slack-multichannel.rb expects proxy_addr in the handler configuration - this is the key difference. Before I found this, none of my alerts were going to slack at all.
I never would have went into the source had you not posted your config. When I saw your config I said “Huh, where in handler-slack.rb can we define markdown mode? I don’t see it on their main documentation page, let me look at the source.” When it wasn’t in the source code for handler-slack.rb, I went to look at handler-slack-multichannel.rb and saw it declared there. For giggles I thought “I wonder if all of the proxy get_settings options are the same here?” and they weren’t.
So, hopefully this helps someone who’s using a proxy and still wants slack multichannel goodness.
Thanks, again, Aiman!
David
···
On Tuesday, April 25, 2017 at 2:16:46 PM UTC-4, David R wrote:
Hey, Aiman,
This is immensely helpful; thank you!
David
On Tuesday, April 25, 2017 at 1:24:10 PM UTC-4, aiman parvaiz wrote:
Hey David
The way I got it working is as follows:
I am using multichannel_slack.rb and I have it’s json file in the conf.d directory, this is the content of that file:
All alerts by default go to alerts, in cases where I want to report to some other channel I include the channel name in the json of the check, for example:
and this way I am able to get alerts sent to various channels, my requirement was to send the alert to any one of the channels depending on the check and this solution works for that case.
I hope this helps.
Thanks
On Thursday, April 20, 2017 at 5:21:21 AM UTC-7, David R wrote:
The documentation embedded into the source for the handler-slack-multichannel is a bit sparse. Any ideas on how one would define the various channels? For the basic slack module, one has to define a webhook_url. Presumably, with the multichannel plugin, one would have a list of webhook_urls to define for the various channels (default, compulsory, etc). I’ve tried a few variations on my own, but to no avail. Any guidance would be most appreciated!
On Wednesday, February 22, 2017 at 11:48:08 PM UTC-5, Kyle Anderson wrote:
All the json files in conf.d get merged together, so there is only one “slack”: configuration hash manifesting.
You will probably have to do something that understands multi-channel more natively
Hi all
I am trying to get certain alerts to one slack channel and rest to a separate one. I am using sensu 0.26.5. I have two json files for handlers in /etc/sensu/conf.d
I am specifying handler to use in the check definition, for example:
{
“checks”: {
“cassandra_ntp”: {
“handler”: “cops_slack”,
“command”: “check-process.rb -p ntp -W 1”,
“subscribers”: [
“ABCD”
],
“interval”: 60
}
}
}
This setup is not working for me. For some strange reasons if I remove my_handler.json from conf.d/ cops_slack handler would kick in as expected and would report to the expected channel but as soon as I bring back my_handler (restart sensu server, api) the same check now would report to the channel mentioned in my_handler. I have reproduced this several times and am out of ideas here. I would be grateful if some one can help me out here.