Skip to content

Commit

Permalink
Add multiline support (ericoc#16 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
sander85 committed Sep 6, 2017
1 parent 04f5099 commit 1990729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mattermost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ fi

# The message that we want to send to Mattermost is the "subject" value ($2 / $subject - that we got earlier)
# followed by the message that Zabbix actually sent us ($3)
message="${subject}: $3"
zabbix_msg="${3//$'\r'/\\r}"
message="${subject}: $zabbix_msg"

# Build our JSON payload and send it as a POST request to the Mattermost incoming web-hook URL
payload="payload={\"icon_url\": \"$icon\", \"attachments\": [ {\"color\": \"${color}\", \"text\": \"${message}\"} ], \"channel\": \"${to}\", \"username\": \"${username}\", \"icon_emoji\": \"${emoji}\"}"
Expand Down

0 comments on commit 1990729

Please sign in to comment.