centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 273 forks source link

Teams notification: will not work using workflow #5100

Closed joschi99 closed 3 weeks ago

joschi99 commented 2 months ago

Microsoft will stop within 15th August the Incoming Webhook on Teams wich is used to send notifications into Teams:

Action Required:
O365 connectors within Teams will be deprecated and notifications from this service will stop.
[Learn more](https://aka.ms/O365ConnectorDeprecation)
about the timing and how the Workflows app provides a more flexible and secure experience. If you want to continue receiving these types of messages, you can use a workflow to post messages from a webhook request.
[Set up workflow](https://teams.microsoft.com/l/task/c3a1996d-db0f-4857-a6ea-7aabf0266b00?url=https://make.powerautomate.com/teams/store/flowCreation?templateId=d271a6f01c2545a28348d8f2cddf4c8f)

Creating a workflow that will generating a Teams Message using a webhook (https://office365itpros.com/2024/06/17/teams-post-to-channel-workflow/) seem's not supported by the plugin. You should update the plugin to support the new method.

lucie-dubrunfaut commented 2 months ago

Hello :)

A big thank you for this alert, we are taking care of the subject as quickly as possible. If you could possibly be available for testing the workflows once we have a plugin dev proposal on the subject that would be very appreciated.

joschi99 commented 2 months ago

if you have a test version I can test it

SavCent commented 1 month ago

hi, yes we are very interested to test it as soon as possible.

CPevance commented 1 month ago

Can I have an update regarding this issue.

Thank you!

lucie-dubrunfaut commented 1 month ago

Hello :)

The development is in progress, as soon as a testable proposal will be available you will be noticed here. This development is scheduled to be available before August 15.

sdepassio commented 1 month ago

Hello,

The development is done, and the PR is ready.

You can test it by checking the branch "CTOR-758-plugin-notification-microsoft-office-365-teams-mode-alert-add-workflow-for-wehbook" or you can download the package for your platform here, and just use the option --teams-workflow instead of --teams-webhook.

Let us know if you encounter any problem.

joschi99 commented 1 month ago

I have done a test to send a notification through the workflow. The notification will be sended and teams show's it: image

but there is also some error:

./centreon_plugins.pl --plugin=notification::microsoft::office365::teams::plugin --custommode=workflowapi --mode=alert --teams-workflow='https://prod-249.westeurope.logic.azure.com:443/workflows/d2fedb9915e0XXXXcb9d9/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=JvSvwObXXXXFfYi3I18' --host-name='my_host_1' --host-state='DOWN' --host-output='CRITICAL -y_host_1: rta nan, lost 100%' --centreon-url='https://127.0.0.1/centreon' --action-links --notification-type=host
Use of uninitialized value $themecolor in string at /tmp/joschi/centreon-plugins-CTOR-758-plugin-notification-microsoft-office-365-teams-mode-alert-add-workflow-for-wehbook/src/notification/microsoft/office365/teams/mode/alert.pm line 359.
Use of uninitialized value $themecolor in string at /tmp/joschi/centreon-plugins-CTOR-758-plugin-notification-microsoft-office-365-teams-mode-alert-add-workflow-for-wehbook/src/notification/microsoft/office365/teams/mode/alert.pm line 367.
fmattesct commented 3 weeks ago

This issue is solved (see PR)