metadata.yaml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. # yamllint disable rule:line-length
  2. ---
  3. - id: 'notify-cloud-discord'
  4. meta:
  5. name: 'Discord'
  6. link: 'https://discord.com/'
  7. categories:
  8. - notify.cloud
  9. icon_filename: 'discord.png'
  10. keywords:
  11. - discord
  12. - community
  13. overview:
  14. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on Discord."
  15. notification_limitations: ''
  16. setup:
  17. description: |
  18. ### Prerequisites
  19. - A Netdata Cloud account
  20. - Access to the Netdata Space as an **administrator**
  21. - You need to have a Discord server able to receive webhooks integrations.
  22. ### Discord Server Configuration
  23. Steps to configure your Discord server to receive [webhook notifications](https://support.discord.com/hc/en-us/articles/228383668) from Netdata:
  24. 1. Go to `Server Settings` --> `Integrations`
  25. 2. **Create Webhook** or **View Webhooks** if you already have some defined
  26. 3. Specify the **Name** and **Channel** on your new webhook
  27. 4. Use Webhook URL to add your notification configuration on Netdata UI
  28. ### Netdata Configuration Steps
  29. 1. Click on the **Space settings** cog (located above your profile icon)
  30. 2. Click on the **Notification** tab
  31. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  32. 4. On the **Discord** card click on **+ Add**
  33. 5. A modal will be presented to you to enter the required details to enable the configuration:
  34. * **Notification settings** are Netdata specific settings
  35. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  36. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  37. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  38. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For Discord:
  39. - Define the type channel you want to send notifications to: **Text channel** or **Forum channel**
  40. - Webhook URL - URL provided on Discord for the channel you want to receive your notifications.
  41. - Thread name - if the Discord channel is a **Forum channel** you will need to provide the thread name as well
  42. - id: 'notify-cloud-pagerduty'
  43. meta:
  44. name: 'PagerDuty'
  45. link: 'https://www.pagerduty.com/'
  46. categories:
  47. - notify.cloud
  48. icon_filename: 'pagerduty.png'
  49. keywords:
  50. - pagerduty
  51. overview:
  52. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on PagerDuty."
  53. notification_limitations: ''
  54. setup:
  55. description: |
  56. ### Prerequisites
  57. - A Netdata Cloud account
  58. - Access to the Netdata Space as an **administrator**
  59. - The Netdata Space needs to be on **Business** plan or higher
  60. - You need to have a PagerDuty service to receive events using webhooks.
  61. ### PagerDuty Server Configuration
  62. Steps to configure your PagerDuty to receive notifications from Netdata:
  63. 1. Create a service to receive events from your services directory page on PagerDuty
  64. 2. At step 3, select `Events API V2` Integration or **View Webhooks** if you already have some defined
  65. 3. Once the service is created you will be redirected to its configuration page, where you can copy the **integration key**, that you will need need to add to your notification configuration on Netdata UI.
  66. ### Netdata Configuration Steps
  67. 1. Click on the **Space settings** cog (located above your profile icon)
  68. 2. Click on the **Notification** tab
  69. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  70. 4. On the **PagerDuty** card click on **+ Add**
  71. 5. A modal will be presented to you to enter the required details to enable the configuration:
  72. * **Notification settings** are Netdata specific settings
  73. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  74. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  75. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  76. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For PagerDuty:
  77. - Integration Key - is a 32 character key provided by PagerDuty to receive events on your service.
  78. - id: 'notify-cloud-slack'
  79. meta:
  80. name: 'Slack'
  81. link: 'https://slack.com/'
  82. categories:
  83. - notify.cloud
  84. icon_filename: 'slack.png'
  85. keywords:
  86. - slack
  87. overview:
  88. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on Slack."
  89. notification_limitations: ''
  90. setup:
  91. description: |
  92. ### Prerequisites
  93. - A Netdata Cloud account
  94. - Access to the Netdata Space as an **administrator**
  95. - The Netdata Space needs to be on **Business** plan or higher
  96. - You need to have a Slack app on your workspace to receive the Webhooks.
  97. ### Slack Server Configuration
  98. Steps to configure your Slack to receive notifications from Netdata:
  99. 1. Create an app to receive webhook integrations. Check [Create an app](https://api.slack.com/apps?new_app=1) from Slack documentation for further details
  100. 2. Install the app on your workspace
  101. 3. Configure Webhook URLs for your workspace
  102. - On your app go to **Incoming Webhooks** and click on **activate incoming webhooks**
  103. - At the bottom of **Webhook URLs for Your Workspace** section you have **Add New Webhook to Workspace**
  104. - After pressing that specify the channel where you want your notifications to be delivered
  105. - Once completed copy the Webhook URL that you will need to add to your notification configuration on Netdata UI
  106. For more details please check Slacks's article [Incoming webhooks for Slack](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack).
  107. ### Netdata Configuration Steps
  108. 1. Click on the **Space settings** cog (located above your profile icon)
  109. 2. Click on the **Notification** tab
  110. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  111. 4. On the **Slack** card click on **+ Add**
  112. 5. A modal will be presented to you to enter the required details to enable the configuration:
  113. * **Notification settings** are Netdata specific settings
  114. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  115. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  116. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  117. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For Slack:
  118. - Webhook URL - URL provided on Slack for the channel you want to receive your notifications.
  119. - id: 'notify-cloud-opsgenie'
  120. meta:
  121. name: 'Opsgenie'
  122. link: 'https://www.atlassian.com/software/opsgenie'
  123. categories:
  124. - notify.cloud
  125. icon_filename: 'opsgenie.png'
  126. keywords:
  127. - opsgenie
  128. - atlassian
  129. overview:
  130. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on Opsgenie."
  131. notification_limitations: ''
  132. setup:
  133. description: |
  134. ### Prerequisites
  135. - A Netdata Cloud account
  136. - Access to the Netdata Space as an **administrator**
  137. - The Netdata Space needs to be on **Business** plan or higher
  138. - You need to have permissions on Opsgenie to add new integrations.
  139. ### Opsgenie Server Configuration
  140. Steps to configure your Opsgenie to receive notifications from Netdata:
  141. 1. Go to integrations tab of your team, click **Add integration**
  142. 2. Pick **API** from available integrations. Copy your API Key and press **Save Integration**.
  143. 3. Paste copied API key into the corresponding field in **Integration configuration** section of Opsgenie modal window in Netdata.
  144. ### Netdata Configuration Steps
  145. 1. Click on the **Space settings** cog (located above your profile icon)
  146. 2. Click on the **Notification** tab
  147. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  148. 4. On the **Opsgenie** card click on **+ Add**
  149. 5. A modal will be presented to you to enter the required details to enable the configuration:
  150. * **Notification settings** are Netdata specific settings
  151. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  152. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  153. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  154. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For Opsgenie:
  155. - API Key - a key provided on Opsgenie for the channel you want to receive your notifications.
  156. - id: 'notify-cloud-mattermost'
  157. meta:
  158. name: 'Mattermost'
  159. link: 'https://mattermost.com/'
  160. categories:
  161. - notify.cloud
  162. icon_filename: 'mattermost.png'
  163. keywords:
  164. - mattermost
  165. overview:
  166. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on Mattermost."
  167. notification_limitations: ''
  168. setup:
  169. description: |
  170. ### Prerequisites
  171. - A Netdata Cloud account
  172. - Access to the Netdata Space as an **administrator**
  173. - The Netdata Space needs to be on **Business** plan or higher
  174. - You need to have permissions on Mattermost to add new integrations.
  175. - You need to have a Mattermost app on your workspace to receive the webhooks.
  176. ### Mattermost Server Configuration
  177. Steps to configure your Mattermost to receive notifications from Netdata:
  178. 1. In Mattermost, go to Product menu > Integrations > Incoming Webhook
  179. - If you don’t have the Integrations option, incoming webhooks may not be enabled on your Mattermost server or may be disabled for non-admins. They can be enabled by a System Admin from System Console > Integrations > Integration Management. Once incoming webhooks are enabled, continue with the steps below.
  180. 2. Select Add Incoming Webhook and add a name and description for the webhook. The description can be up to 500 characters
  181. 3. Select the channel to receive webhook payloads, then select Add to create the webhook
  182. 4. You will end up with a webhook endpoint that looks like below:
  183. `https://your-mattermost-server.com/hooks/xxx-generatedkey-xxx`
  184. - Treat this endpoint as a secret. Anyone who has it will be able to post messages to your Mattermost instance.
  185. For more details please check Mattermost's article [Incoming webhooks for Mattermost](https://developers.mattermost.com/integrate/webhooks/incoming/).
  186. ### Netdata Configuration Steps
  187. 1. Click on the **Space settings** cog (located above your profile icon)
  188. 2. Click on the **Notification** tab
  189. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  190. 4. On the **Mattermost** card click on **+ Add**
  191. 5. A modal will be presented to you to enter the required details to enable the configuration:
  192. * **Notification settings** are Netdata specific settings
  193. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  194. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  195. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  196. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For Mattermost:
  197. - Webhook URL - URL provided on Mattermost for the channel you want to receive your notifications
  198. - id: 'notify-cloud-rocketchat'
  199. meta:
  200. name: 'RocketChat'
  201. link: 'https://www.rocket.chat/'
  202. categories:
  203. - notify.cloud
  204. icon_filename: 'rocketchat.png'
  205. keywords:
  206. - rocketchat
  207. overview:
  208. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on RocketChat."
  209. notification_limitations: ''
  210. setup:
  211. description: |
  212. ### Prerequisites
  213. - A Netdata Cloud account
  214. - Access to the Netdata Space as an **administrator**
  215. - The Netdata Space needs to be on **Business** plan or higher
  216. - You need to have permissions on Mattermost to add new integrations.
  217. - You need to have a RocketChat app on your workspace to receive the webhooks.
  218. ### Mattermost Server Configuration
  219. Steps to configure your RocketChat to receive notifications from Netdata:
  220. 1. In RocketChat, Navigate to Administration > Workspace > Integrations.
  221. 2. Click **+New** at the top right corner.
  222. 3. For more details about each parameter, check [create-a-new-incoming-webhook](https://docs.rocket.chat/use-rocket.chat/workspace-administration/integrations#create-a-new-incoming-webhook).
  223. 4. After configuring integration, click Save.
  224. 5. You will end up with a webhook endpoint that looks like below:
  225. `https://your-server.rocket.chat/hooks/YYYYYYYYYYYYYYYYYYYYYYYY/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
  226. - Treat this endpoint as a secret. Anyone who has it will be able to post messages to your RocketChat instance.
  227. For more details please check RocketChat's article Incoming webhooks for [RocketChat](https://docs.rocket.chat/use-rocket.chat/workspace-administration/integrations/).
  228. ### Netdata Configuration Steps
  229. 1. Click on the **Space settings** cog (located above your profile icon)
  230. 2. Click on the **Notification** tab
  231. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  232. 4. On the **RocketChat** card click on **+ Add**
  233. 5. A modal will be presented to you to enter the required details to enable the configuration:
  234. * **Notification settings** are Netdata specific settings
  235. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  236. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  237. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  238. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For RocketChat:
  239. - Webhook URL - URL provided on RocketChat for the channel you want to receive your notifications.
  240. - id: 'notify-cloud-awssns'
  241. meta:
  242. name: 'Amazon SNS'
  243. link: 'https://aws.amazon.com/sns/'
  244. categories:
  245. - notify.cloud
  246. icon_filename: 'awssns.png'
  247. keywords:
  248. - awssns
  249. overview:
  250. notification_description: "From the Cloud interface, you can manage your space's notification settings and from these you can add a specific configuration to get notifications delivered on AWS SNS."
  251. notification_limitations: ''
  252. setup:
  253. description: |
  254. ### Prerequisites
  255. To add AWS SNS notification you need:
  256. - A Netdata Cloud account
  257. - Access to the space as an **administrator**
  258. - Space needs to be on **Business** plan or higher
  259. - Have an AWS account with AWS SNS access, for more details check [how to configure this on AWS SNS](#settings-on-aws-sns)
  260. ### Steps
  261. 1. Click on the **Space settings** cog (located above your profile icon)
  262. 2. Click on the **Notification** tab
  263. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  264. 4. On the **AwsSns** card click on **+ Add**
  265. 5. A modal will be presented to you to enter the required details to enable the configuration:
  266. * **Notification settings** are Netdata specific settings
  267. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  268. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  269. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  270. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For AWS SNS:
  271. - Topic ARN - topic provided on AWS SNS (with region) for where to publish your notifications. For more details check [how to configure this on AWS SNS](#settings-on-aws-sns)
  272. ### Settings on AWS SNS
  273. To enable the webhook integration on AWS SNS you need:
  274. 1. [Setting up access for Amazon SNS](https://docs.aws.amazon.com/sns/latest/dg/sns-setting-up.html)
  275. 2. Create a topic
  276. - On AWS SNS management console click on **Create topic**
  277. - On the **Details** section, the standard type and provide the topic name
  278. - On the **Access policy** section, change the **Publishers** option to **Only the specified AWS accounts** and provide the Netdata AWS account **(123269920060)** that will be used to publish notifications to the topic being created
  279. - Finally, click on **Create topic** on the bottom of the page
  280. 3. Now, use the new **Topic ARN** while adding AWS SNS integration on your space.
  281. - id: 'notify-cloud-telegram'
  282. meta:
  283. name: 'Telegram'
  284. link: 'https://telegram.org/'
  285. categories:
  286. - notify.cloud
  287. icon_filename: 'telegram.svg'
  288. keywords:
  289. - Telegram
  290. overview:
  291. notification_description: "From the Cloud interface, you can manage your space's notification settings and from these you can add a specific configuration to get notifications delivered on Telegram."
  292. notification_limitations: ''
  293. setup:
  294. description: |
  295. ### Prerequisites
  296. To add Telegram notification you need:
  297. - A Netdata Cloud account
  298. - Access to the space as an **administrator**
  299. - Space needs to be on **Business** plan or higher
  300. - The Telegram bot token and chat ID
  301. ### Steps
  302. 1. Click on the **Space settings** cog (located above your profile icon)
  303. 2. Click on the **Notification** tab
  304. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  305. 4. On the **Telegram** card click on **+ Add**
  306. 5. A modal will be presented to you to enter the required details to enable the configuration:
  307. - **Notification settings** are Netdata specific settings
  308. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  309. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  310. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  311. - **Integration configuration** are the specific notification integration required settings, which vary by notification method. For Telegram:
  312. - Bot Token - the token of your bot
  313. - Chat ID - the chat id where your bot will deliver messages to
  314. ### Getting the Telegram bot token and chat ID
  315. - Bot token: To create one bot, contact the [@BotFather](https://t.me/BotFather) bot and send the command `/newbot` and follow the instructions. **Start a conversation with your bot or invite it into the group where you want it to send notifications**.
  316. - To get the chat ID you have two options:
  317. - Contact the [@myidbot](https://t.me/myidbot) bot and send the `/getid` command to get your personal chat ID, or invite it into a group and use the `/getgroupid` command to get the group chat ID.
  318. - Alternatively, you can get the chat ID directly from the bot API. Send your bot a command in the chat you want to use, then check `https://api.telegram.org/bot{YourBotToken}/getUpdates`, eg. `https://api.telegram.org/bot111122223:7OpFlFFRzRBbrUUmIjj5HF9Ox2pYJZy5/getUpdates`
  319. - id: 'notify-cloud-webhook'
  320. meta:
  321. name: 'Webhook'
  322. link: 'https://en.wikipedia.org/wiki/Webhook'
  323. categories:
  324. - notify.cloud
  325. icon_filename: 'webhook.svg'
  326. keywords:
  327. - generic webhooks
  328. - webhooks
  329. overview:
  330. notification_description: "From the Netdata Cloud UI, you can manage your space's notification settings and enable the configuration to deliver notifications on a webhook using a predefined schema."
  331. notification_limitations: ''
  332. setup:
  333. description: |
  334. ### Prerequisites
  335. - A Netdata Cloud account
  336. - Access to the Netdata Space as an **administrator**
  337. - The Netdata Space needs to be on **Pro** plan or higher
  338. - You need to have an app that allows you to receive webhooks following a predefined schema.
  339. ### Netdata Configuration Steps
  340. 1. Click on the **Space settings** cog (located above your profile icon)
  341. 2. Click on the **Notification** tab
  342. 3. Click on the **+ Add configuration** button (near the top-right corner of your screen)
  343. 4. On the **Webhook** card click on **+ Add**
  344. 5. A modal will be presented to you to enter the required details to enable the configuration:
  345. * **Notification settings** are Netdata specific settings
  346. - Configuration name - you can optionally provide a name for your configuration you can easily refer to it
  347. - Rooms - by specifying a list of Rooms you are select to which nodes or areas of your infrastructure you want to be notified using this configuration
  348. - Notification - you specify which notifications you want to be notified using this configuration: All Alerts and unreachable, All Alerts, Critical only
  349. * **Integration configuration** are the specific notification integration required settings, which vary by notification method. For Webhook:
  350. - Webhook URL - webhook URL is the url of the service that Netdata will send notifications to. In order to keep the communication secured, we only accept HTTPS urls.
  351. - Extra headers - these are optional key-value pairs that you can set to be included in the HTTP requests sent to the webhook URL.
  352. - Authentication Mechanism - Netdata webhook integration supports 3 different authentication mechanisms.
  353. * Mutual TLS (recommended) - default authentication mechanism used if no other method is selected.
  354. * Basic - the client sends a request with an Authorization header that includes a base64-encoded string in the format **username:password**. These will settings will be required inputs.
  355. * Bearer - the client sends a request with an Authorization header that includes a **bearer token**. This setting will be a required input.
  356. ### Webhook service
  357. A webhook integration allows your application to receive real-time alerts from Netdata by sending HTTP requests to a specified URL. In this document, we'll go over the steps to set up a generic webhook integration, including adding headers, and implementing different types of authorization mechanisms.
  358. #### Netdata webhook integration
  359. A webhook integration is a way for one service to notify another service about events that occur within it. This is done by sending an HTTP POST request to a specified URL (known as the "webhook URL") when an event occurs.
  360. Netdata webhook integration service will send alert notifications to the destination service as soon as they are detected.
  361. The notification content sent to the destination service will be a JSON object having these properties:
  362. | field | type | description |
  363. | :-- | :-- | :-- |
  364. | message | string | A summary message of the alert. |
  365. | alarm | string | The alarm the notification is about. |
  366. | info | string | Additional info related with the alert. |
  367. | chart | string | The chart associated with the alert. |
  368. | context | string | The chart context. |
  369. | space | string | The space where the node that raised the alert is assigned. |
  370. | rooms | object[object(string,string)] | Object with list of rooms names and urls where the node belongs to. |
  371. | family | string | Context family. |
  372. | class | string | Classification of the alert, e.g. "Error". |
  373. | severity | string | Alert severity, can be one of "warning", "critical" or "clear". |
  374. | date | string | Date of the alert in ISO8601 format. |
  375. | duration | string | Duration the alert has been raised. |
  376. | additional_active_critical_alerts | integer | Number of additional critical alerts currently existing on the same node. |
  377. | additional_active_warning_alerts | integer | Number of additional warning alerts currently existing on the same node. |
  378. | alarm_url | string | Netdata Cloud URL for this alarm. |
  379. #### Extra headers
  380. When setting up a webhook integration, the user can specify a set of headers to be included in the HTTP requests sent to the webhook URL.
  381. By default, the following headers will be sent in the HTTP request
  382. | **Header** | **Value** |
  383. |:-------------------------------:|-----------------------------|
  384. | Content-Type | application/json |
  385. #### Authentication mechanisms
  386. Netdata webhook integration supports 3 different authentication mechanisms:
  387. ##### Mutual TLS authentication (recommended)
  388. In mutual Transport Layer Security (mTLS) authentication, the client and the server authenticate each other using X.509 certificates. This ensures that the client is connecting to the intended server, and that the server is only accepting connections from authorized clients.
  389. This is the default authentication mechanism used if no other method is selected.
  390. To take advantage of mutual TLS, you can configure your server to verify Netdata's client certificate. In order to achieve this, the Netdata client sending the notification supports mutual TLS (mTLS) to identify itself with a client certificate that your server can validate.
  391. The steps to perform this validation are as follows:
  392. - Store Netdata CA certificate on a file in your disk. The content of this file should be:
  393. <details>
  394. <summary>Netdata CA certificate</summary>
  395. ```
  396. -----BEGIN CERTIFICATE-----
  397. MIIF0jCCA7qgAwIBAgIUDV0rS5jXsyNX33evHEQOwn9fPo0wDQYJKoZIhvcNAQEN
  398. BQAwgYAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH
  399. Ew1TYW4gRnJhbmNpc2NvMRYwFAYDVQQKEw1OZXRkYXRhLCBJbmMuMRIwEAYDVQQL
  400. EwlDbG91ZCBTUkUxGDAWBgNVBAMTD05ldGRhdGEgUm9vdCBDQTAeFw0yMzAyMjIx
  401. MjQzMDBaFw0zMzAyMTkxMjQzMDBaMIGAMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
  402. Q2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEWMBQGA1UEChMNTmV0
  403. ZGF0YSwgSW5jLjESMBAGA1UECxMJQ2xvdWQgU1JFMRgwFgYDVQQDEw9OZXRkYXRh
  404. IFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwIg7z3R++
  405. ppQYYVVoMIDlhWO3qVTMsAQoJYEvVa6fqaImUBLW/k19LUaXgUJPohB7gBp1pkjs
  406. QfY5dBo8iFr7MDHtyiAFjcQV181sITTMBEJwp77R4slOXCvrreizhTt1gvf4S1zL
  407. qeHBYWEgH0RLrOAqD0jkOHwewVouO0k3Wf2lEbCq3qRk2HeDvkv0LR7sFC+dDms8
  408. fDHqb/htqhk+FAJELGRqLeaFq1Z5Eq1/9dk4SIeHgK5pdYqsjpBzOTmocgriw6he
  409. s7F3dOec1ZZdcBEAxOjbYt4e58JwuR81cWAVMmyot5JNCzYVL9e5Vc5n22qt2dmc
  410. Tzw2rLOPt9pT5bzbmyhcDuNg2Qj/5DySAQ+VQysx91BJRXyUimqE7DwQyLhpQU72
  411. jw29lf2RHdCPNmk8J1TNropmpz/aI7rkperPugdOmxzP55i48ECbvDF4Wtazi+l+
  412. 4kx7ieeLfEQgixy4lRUUkrgJlIDOGbw+d2Ag6LtOgwBiBYnDgYpvLucnx5cFupPY
  413. Cy3VlJ4EKUeQQSsz5kVmvotk9MED4sLx1As8V4e5ViwI5dCsRfKny7BeJ6XNPLnw
  414. PtMh1hbiqCcDmB1urCqXcMle4sRhKccReYOwkLjLLZ80A+MuJuIEAUUuEPCwywzU
  415. R7pagYsmvNgmwIIuJtB6mIJBShC7TpJG+wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC
  416. AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU9IbvOsPSUrpr8H2zSafYVQ9e
  417. Ft8wDQYJKoZIhvcNAQENBQADggIBABQ08aI31VKZs8jzg+y/QM5cvzXlVhcpkZsY
  418. 1VVBr0roSBw9Pld9SERrEHto8PVXbadRxeEs4sKivJBKubWAooQ6NTvEB9MHuGnZ
  419. VCU+N035Gq/mhBZgtIs/Zz33jTB2ju3G4Gm9VTZbVqd0OUxFs41Iqvi0HStC3/Io
  420. rKi7crubmp5f2cNW1HrS++ScbTM+VaKVgQ2Tg5jOjou8wtA+204iYXlFpw9Q0qnP
  421. qq6ix7TfLLeRVp6mauwPsAJUgHZluz7yuv3r7TBdukU4ZKUmfAGIPSebtB3EzXfH
  422. 7Y326xzv0hEpjvDHLy6+yFfTdBSrKPsMHgc9bsf88dnypNYL8TUiEHlcTgCGU8ts
  423. ud8sWN2M5FEWbHPNYRVfH3xgY2iOYZzn0i+PVyGryOPuzkRHTxDLPIGEWE5susM4
  424. X4bnNJyKH1AMkBCErR34CLXtAe2ngJlV/V3D4I8CQFJdQkn9tuznohUU/j80xvPH
  425. FOcDGQYmh4m2aIJtlNVP6+/92Siugb5y7HfslyRK94+bZBg2D86TcCJWaaZOFUrR
  426. Y3WniYXsqM5/JI4OOzu7dpjtkJUYvwtg7Qb5jmm8Ilf5rQZJhuvsygzX6+WM079y
  427. nsjoQAm6OwpTN5362vE9SYu1twz7KdzBlUkDhePEOgQkWfLHBJWwB+PvB1j/cUA3
  428. 5zrbwvQf
  429. -----END CERTIFICATE-----
  430. ```
  431. </details>
  432. - Enable client certificate validation on the web server that is doing the TLS termination. Below we show you how to perform this configuration in `NGINX` and `Apache`
  433. **NGINX**
  434. ```bash
  435. server {
  436. listen 443 ssl default_server;
  437. # ... existing SSL configuration for server authentication ...
  438. ssl_verify_client on;
  439. ssl_client_certificate /path/to/Netdata_CA.pem;
  440. location / {
  441. if ($ssl_client_s_dn !~ "CN=app.netdata.cloud") {
  442. return 403;
  443. }
  444. # ... existing location configuration ...
  445. }
  446. }
  447. ```
  448. **Apache**
  449. ```bash
  450. Listen 443
  451. <VirtualHost *:443>
  452. # ... existing SSL configuration for server authentication ...
  453. SSLVerifyClient require
  454. SSLCACertificateFile "/path/to/Netdata_CA.pem"
  455. </VirtualHost>
  456. <Directory /var/www/>
  457. Require expr "%{SSL_CLIENT_S_DN_CN} == 'app.netdata.cloud'"
  458. # ... existing directory configuration ...
  459. </Directory>
  460. ```
  461. ##### Basic authentication
  462. In basic authorization, the client sends a request with an Authorization header that includes a base64-encoded string in the format username:password. The server then uses this information to authenticate the client. If this authentication method is selected, the user can set the user and password that will be used when connecting to the destination service.
  463. ##### Bearer token authentication
  464. In bearer token authentication, the client sends a request with an Authorization header that includes a bearer token. The server then uses this token to authenticate the client. Bearer tokens are typically generated by an authentication service, and are passed to the client after a successful authentication. If this method is selected, the user can set the token to be used for connecting to the destination service.
  465. ###### Challenge secret
  466. To validate that you has ownership of the web application that will receive the webhook events, we are using a challenge response check mechanism.
  467. This mechanism works as follows:
  468. - The challenge secret parameter that you provide is a shared secret between you and Netdata only.
  469. - On your request for creating a new Webhook integration, we will make a GET request to the url of the webhook, adding a query parameter `crc_token`, consisting of a random string.
  470. - You will receive this request on your application and it must construct an encrypted response, consisting of a base64-encoded HMAC SHA-256 hash created from the crc_token and the shared secret. The response will be in the format:
  471. ```json
  472. {
  473. "response_token": "sha256=9GKoHJYmcHIkhD+C182QWN79YBd+D+Vkj4snmZrfNi4="
  474. }
  475. ```
  476. - We will compare your application's response with the hash that we will generate using the challenge secret, and if they are the same, the integration creation will succeed.
  477. We will do this validation everytime you update your integration configuration.
  478. - Response requirements:
  479. - A base64 encoded HMAC SHA-256 hash created from the crc_token and the shared secret.
  480. - Valid response_token and JSON format.
  481. - Latency less than 5 seconds.
  482. - 200 HTTP response code.
  483. **Example response token generation in Python:**
  484. Here you can see how to define a handler for a Flask application in python 3:
  485. ```python
  486. import base64
  487. import hashlib
  488. import hmac
  489. import json
  490. key ='YOUR_CHALLENGE_SECRET'
  491. @app.route('/webhooks/netdata')
  492. def webhook_challenge():
  493. token = request.args.get('crc_token').encode('ascii')
  494. # creates HMAC SHA-256 hash from incomming token and your consumer secret
  495. sha256_hash_digest = hmac.new(key.encode(),
  496. msg=token,
  497. digestmod=hashlib.sha256).digest()
  498. # construct response data with base64 encoded hash
  499. response = {
  500. 'response_token': 'sha256=' + base64.b64encode(sha256_hash_digest).decode('ascii')
  501. }
  502. # returns properly formatted json response
  503. return json.dumps(response)
  504. ```