Community discussions

MikroTik App
 
algisr
newbie
Topic Author
Posts: 27
Joined: Sat Apr 28, 2018 11:30 am

Change Slacks Webhook to Microsoft Teams Webhook on Dude

Thu Oct 03, 2019 8:29 am

Currently we use Dude to monitor +150 different devices and/or connections (SIte-to-Site VPN, EoIP connection, External Devices, IPsec PH2 loopback IP on other side monitoring and etc.).
Recently our CEO announced that we will be migrating from Slack to Teams. Quick looking at Microsoft Teams Connectors revealed that they indead support Incomming Webhooks. That leaves the problem to Migrate Slack #Dude channel to Microsoft Teams because of course the sintax for webhooking is different on Teams that it is now on Slack.

Currently our dude server use current settings to inform us via Slack (Notifications):

Name: Slack
Type: execute on server
Command:
/tool fetch mode=https url="https://hooks.slack.com/services/AAAAA/ ... CCCCCCCCCC" http-method=post http-data="payload={\"text\":\"<[TimeAndDate]> Service [Probe.Name] on [Device.Name] ([Device.FirstAddress]) is now [Service.Status] ([Service.ProblemDescription])\"}"
Name: Slack > up to down | unstable to down
Type: execute on server
Command:
/tool fetch mode=https url="https://hooks.slack.com/services/AAAAA/ ... CCCCCCCCCC" http-method=post http-data="payload={\"attachments\": [ { \"title\": \"[Device.Name] is now [Service.Status]\", \"text\": \"<[TimeAndDate]> Service [Probe.Name] ([Device.FirstAddress]) on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])\", \"color\": \"danger\" } ] }"
Name: Slack > down to up
Type: execute on server
Command:
/tool fetch mode=https url="https://hooks.slack.com/services/AAAAA/ ... CCCCCCCCCC" http-method=post http-data="payload={\"attachments\": [ { \"title\": \"[Device.Name] is now [Service.Status]\", \"text\": \"<[TimeAndDate]> Service [Probe.Name] ([Device.FirstAddress]) on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])\", \"color\": \"good\" } ] }"
Those 3 commands are enough to report UP->DOWN and DOWN->UP Status on Slack.

Maybe someone already did migration and ca write here correct command for Microsoft Teams which I can use to "execute on Server" in Slack?
 
algisr
newbie
Topic Author
Posts: 27
Joined: Sat Apr 28, 2018 11:30 am

Re: Change Slacks Webhook to Microsoft Teams Webhook on Dude  [SOLVED]

Thu Oct 03, 2019 12:25 pm

Solution was to change execution to this:

SLACK UP-TO-DOWN:
/tool fetch mode=https url="https://outlook.office.com/webhook/AAA/ ... ok/BBB/XXX" http-method=post http-data="{\"@context\": \"https://schema.org/extensions\",\"@type\": \"MessageCard\",\"summary\": \"This is the summary property\",\"themeColor\": \"FF0000\",\"sections\": [{\"text\": \"<**[TimeAndDate]**> Service **[Probe.Name]** (**[Device.FirstAddress]**) on **[Device.Name]** is now **[Service.Status]** (**[Service.ProblemDescription]**)\"}],\"summary\": \"THE DUDE Posted:\",\"themeColor\": \"FF0000\",\"title\": \"[Device.Name] is now [Service.Status]\"}"
SLACK (default):
/tool fetch mode=https url="https://outlook.office.com/webhook/AAA/ ... ok/BBB/XXX" http-method=post http-data="{\"@context\": \"https://schema.org/extensions\",\"@type\": \"MessageCard\",\"summary\": \"This is the summary property\",\"sections\": [{\"text\": \"<**[TimeAndDate]**> Service **[Probe.Name]** on **[Device.Name]** (**[Device.FirstAddress]**) is now **[Service.Status]** (**[Service.ProblemDescription]**)\"}],\"summary\": \"THE DUDE Posted:\"}"
SLACK-UP:
/tool fetch mode=https url="https://outlook.office.com/webhook/AAA/ ... ok/BBB/XXX" http-method=post http-data="{\"@context\": \"https://schema.org/extensions\",\"@type\": \"MessageCard\",\"summary\": \"This is the summary property\",\"themeColor\": \"32CD32\",\"sections\": [{\"text\": \"<**[TimeAndDate]**> Service **[Probe.Name]** (**[Device.FirstAddress]**) on **[Device.Name]** is now **[Service.Status]** (**[Service.ProblemDescription]**)\"}],\"summary\": \"THE DUDE Posted:\",\"themeColor\": \"32CD32\",\"title\": \"[Device.Name] is now [Service.Status]\"}"

Who is online

Users browsing this forum: No registered users and 8 guests