master
md 121 lines 3.56 KB
Rendered Raw
1 <!--startmeta
2 custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/health/notifications/flock/README.md"
3 meta_yaml: "https://github.com/netdata/netdata/edit/master/src/health/notifications/flock/metadata.yaml"
4 sidebar_label: "Flock"
5 learn_status: "Published"
6 learn_rel_path: "Alerts & Notifications/Notifications/Agent Dispatched Notifications"
7 keywords: ['Flock']
8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE NOTIFICATION'S metadata.yaml FILE"
9 endmeta-->
10
11 # Flock
12
13
14 <img src="https://netdata.cloud/img/flock.png" width="150"/>
15
16
17 Send notifications to Flock 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 flock.com. You can use the same on all your Netdata servers (or you can have multiple if you like). Read more about flock webhooks and how to get one [here](https://admin.flock.com/webhooks).
30 - Access to the terminal where Netdata Agent is running
31
32
33
34 ### Configuration
35
36 #### Options
37
38 The following options can be defined for this notification
39
40 <details open><summary>Config Options</summary>
41
42
43
44 | Option | Description | Default | Required |
45 |:-----|:------------|:--------|:---------:|
46 | SEND_FLOCK | Set `SEND_FLOCK` to YES | YES | yes |
47 | FLOCK_WEBHOOK_URL | set `FLOCK_WEBHOOK_URL` to your webhook URL. | | yes |
48 | [DEFAULT_RECIPIENT_FLOCK](#option-default-recipient-flock) | Set `DEFAULT_RECIPIENT_FLOCK` to the Flock channel you want the alert notifications to be sent to. All roles will default to this variable if left unconfigured. | | yes |
49
50 <a id="option-default-recipient-flock"></a>
51 ##### DEFAULT_RECIPIENT_FLOCK
52
53 You can have different channels per role, by editing DEFAULT_RECIPIENT_FLOCK with the channel you want, in the following entries at the bottom of the same file:
54 ```text
55 role_recipients_flock[sysadmin]="systems"
56 role_recipients_flock[domainadmin]="domains"
57 role_recipients_flock[dba]="databases systems"
58 role_recipients_flock[webmaster]="marketing development"
59 role_recipients_flock[proxyadmin]="proxy-admin"
60 role_recipients_flock[sitemgr]="sites"
61 ```
62
63
64
65 </details>
66
67
68
69 #### via File
70
71 The configuration file name for this integration is `health_alarm_notify.conf`.
72
73
74 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
75 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
76
77 ```bash
78 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
79 sudo ./edit-config health_alarm_notify.conf
80 ```
81
82 ##### Examples
83
84 ###### Basic Configuration
85
86
87
88 ```yaml
89 #------------------------------------------------------------------------------
90 # flock (flock.com) global notification options
91
92 SEND_FLOCK="YES"
93 FLOCK_WEBHOOK_URL="https://api.flock.com/hooks/sendMessage/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
94 DEFAULT_RECIPIENT_FLOCK="alarms"
95
96 ```
97
98
99 ## Troubleshooting
100
101 ### Test Notification
102
103 You can run the following command by hand, to test alerts configuration:
104
105 ```bash
106 # become user netdata
107 sudo su -s /bin/bash netdata
108
109 # enable debugging info on the console
110 export NETDATA_ALARM_NOTIFY_DEBUG=1
111
112 # send test alarms to sysadmin
113 /usr/libexec/netdata/plugins.d/alarm-notify.sh test
114
115 # send test alarms to any role
116 /usr/libexec/netdata/plugins.d/alarm-notify.sh test "ROLE"
117 ```
118
119 Note that this will test _all_ alert mechanisms for the selected role.
120
121