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 274 forks source link

[notification::microsoft::office365::teams] - Automated notification issue #4123

Open volgur opened 1 year ago

volgur commented 1 year ago

Hello, I have an issue with notifications on Teams. First of all, the notification system is working since I got them by mail.

When I check on cli the output of my notification command, I got a "Unknown option" output : centreon -u 'Centreon_Notifs' -p 'XXXXXXXXXXX' -c "/usr/lib/centreon/plugins/centreon-plugins/centreon_notification_teams.pl --plugin=notification::microsoft::office365::teams::plugin --mode=alert --custommode=webhookapi --teams-webhook='https://XXXXXX.webhook.office.com/webhookb2/.........' --host-name='my_host_1' --host-state='DOWN' --host-output='CRITICAL -my_host_1: rta nan, lost 100%' --centreon-url='http://MY_CENTREON/centreon/' --action-links --notification-type=critical" Unknown option

When I execute the script directly, the output is different, but I finnaly got an incoming message on my Teams : perl centreon_notification_teams.pl --plugin=notification::microsoft::office365::teams::plugin --mode=alert --custommode=webhookapi --teams-webhook='https://XXXXXXXXXX.webhook.office.com/webhookb2/........' --host-name='my_host_1' --host-state='DOWN' --host-output='CRITICAL -my_host_1: rta nan, lost 100%' --centreon-url='http://MY_CENTREON/centreon/' --action-links --notification-type=critical Use of uninitialized value in concatenation (.) or string at /usr/lib/centreon/plugins/centreon-plugins/notification/microsoft/office365/teams/mode/alert.pm line 76.

What am I doing wrong ?

Thanks for your help :)

volgur commented 1 year ago

Little update : I still have the "unknown option" output on the first try, but I got Teams notification now. From the second test, I have no more output.

The only change I made is on the notification command, I checked the box "activate shell"

garnier-quentin commented 1 year ago

First you don't need to activate shell for the command.

Why do you use centreon cli to execute a command ? It's not design for that

lucie-dubrunfaut commented 5 months ago

Hello :)

Without additional information we are not able to provide a solution or resolve a possible bug. So @volgur if you still need a response / solution to this issue, can you answer to Quentin's question?