Closed michaelpporter closed 5 years ago
I am having similar problems. Were you able to figure out a solution @michaelpporter ?
Sooo I ended up getting it working by creating the line with this syntax:
"payload_template": "/etc/sensu/conf.d/payload.erb"
and putting in the following:
"attachments": [
{
"title": "Uchiwa Dashboard",
"title_link": "<insert dashboard link here>",
"color": "<%= color %>",
"fields": [
{
"title": "Status",
"value": "<%= translate_status %>",
"short": false
},
{
"title": "Client Name",
"value": "<%= @event['client']['name'] %>",
"short": true
},
{
"title": "IP address",
"value": "<%= @event['client']['address'] %>",
"short": true
},
{
"title": "Check Name",
"value": "<%= @event['check']['name'] %>",
"short": true
},
{
"title": "Action",
"value": "<%= @event['action'] %>",
"short": true
},
{
"title": "Output",
"value": "<%= @event['check']['output'] %>",
"short": false
}
]
}
]
}```
I am trying to update the message to Slack to use the client name in place of the address in slack messages. I thought using a
payload_template
would allow me to customize it, but when I add it I no longer get any slack notices. I looked over the noted posted in #24 and #16 The message template is working and has been for a while. What, am I missing?handler-sklack.json
slack_payload.erb
slack.erb