master
md 126 lines 3.96 KB
Rendered Raw
1 <!--startmeta
2 custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/health/notifications/msteams/README.md"
3 meta_yaml: "https://github.com/netdata/netdata/edit/master/src/health/notifications/msteams/metadata.yaml"
4 sidebar_label: "Microsoft Teams"
5 learn_status: "Published"
6 learn_rel_path: "Alerts & Notifications/Notifications/Agent Dispatched Notifications"
7 keywords: ['Microsoft', 'Teams', 'MS teams']
8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE NOTIFICATION'S metadata.yaml FILE"
9 endmeta-->
10
11 # Microsoft Teams
12
13
14 <img src="https://netdata.cloud/img/msteams.svg" width="150"/>
15
16
17 You can send Netdata alerts to Microsoft Teams using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more.
18
19
20 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21
22 ## Setup
23
24
25 ### Prerequisites
26
27 ####
28
29 - The incoming webhook URL as given by Microsoft Teams. You can use the same on all your Netdata servers (or you can have multiple if you like).
30 - One or more channels to post the messages to
31 - Access to the terminal where Netdata Agent is running
32
33
34
35 ### Configuration
36
37 #### Options
38
39 The following options can be defined for this notification
40
41 <details open><summary>Config Options</summary>
42
43
44
45 | Option | Description | Default | Required |
46 |:-----|:------------|:--------|:---------:|
47 | SEND_MSTEAMS | Set `SEND_MSTEAMS` to YES | YES | yes |
48 | MSTEAMS_WEBHOOK_URL | set `MSTEAMS_WEBHOOK_URL` to the incoming webhook URL as given by Microsoft Teams. | | yes |
49 | [DEFAULT_RECIPIENT_MSTEAMS](#option-default-recipient-msteams) | Set `DEFAULT_RECIPIENT_MSTEAMS` to the encoded Microsoft Teams channel name you want the alert notifications to be sent to. | | yes |
50
51 <a id="option-default-recipient-msteams"></a>
52 ##### DEFAULT_RECIPIENT_MSTEAMS
53
54 In Microsoft Teams the channel name is encoded in the URI after `/IncomingWebhook/`. You can define multiple channels like this: `CHANNEL1` `CHANNEL2`.
55
56 All roles will default to this variable if left unconfigured.
57
58 You can have different channels per role, by editing `DEFAULT_RECIPIENT_MSTEAMS` with the channel you want, in the following entries at the bottom of the same file:
59 ```text
60 role_recipients_msteams[sysadmin]="CHANNEL1"
61 role_recipients_msteams[domainadmin]="CHANNEL2"
62 role_recipients_msteams[dba]="databases CHANNEL3"
63 role_recipients_msteams[webmaster]="CHANNEL4"
64 role_recipients_msteams[proxyadmin]="CHANNEL5"
65 role_recipients_msteams[sitemgr]="CHANNEL6"
66 ```
67
68
69
70 </details>
71
72
73
74 #### via File
75
76 The configuration file name for this integration is `health_alarm_notify.conf`.
77
78
79 You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the
80 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
81
82 ```bash
83 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
84 sudo ./edit-config health_alarm_notify.conf
85 ```
86
87 ##### Examples
88
89 ###### Basic Configuration
90
91
92
93 ```yaml
94 #------------------------------------------------------------------------------
95 # Microsoft Teams (office.com) global notification options
96
97 SEND_MSTEAMS="YES"
98 MSTEAMS_WEBHOOK_URL="https://outlook.office.com/webhook/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX@XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/IncomingWebhook/CHANNEL/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
99 DEFAULT_RECIPIENT_MSTEAMS="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
100
101 ```
102
103
104 ## Troubleshooting
105
106 ### Test Notification
107
108 You can run the following command by hand, to test alerts configuration:
109
110 ```bash
111 # become user netdata
112 sudo su -s /bin/bash netdata
113
114 # enable debugging info on the console
115 export NETDATA_ALARM_NOTIFY_DEBUG=1
116
117 # send test alarms to sysadmin
118 /usr/libexec/netdata/plugins.d/alarm-notify.sh test
119
120 # send test alarms to any role
121 /usr/libexec/netdata/plugins.d/alarm-notify.sh test "ROLE"
122 ```
123
124 Note that this will test _all_ alert mechanisms for the selected role.
125
126