master
md 141 lines 4.13 KB
Rendered Raw
1 <!--startmeta
2 custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/health/notifications/irc/README.md"
3 meta_yaml: "https://github.com/netdata/netdata/edit/master/src/health/notifications/irc/metadata.yaml"
4 sidebar_label: "IRC"
5 learn_status: "Published"
6 learn_rel_path: "Alerts & Notifications/Notifications/Agent Dispatched Notifications"
7 keywords: ['IRC']
8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE NOTIFICATION'S metadata.yaml FILE"
9 endmeta-->
10
11 # IRC
12
13
14 <img src="https://netdata.cloud/img/irc.png" width="150"/>
15
16
17 Send notifications to IRC 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 `nc` utility. You can set the path to it, or Netdata will search for it in your system `$PATH`.
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 | [nc path](#option-nc-path) | Set the path for nc, otherwise Netdata will search for it in your system $PATH | | yes |
47 | SEND_IRC | Set `SEND_IRC` YES. | YES | yes |
48 | IRC_NETWORK | Set `IRC_NETWORK` to the IRC network which your preferred channels belong to. | | yes |
49 | IRC_PORT | Set `IRC_PORT` to the IRC port to which a connection will occur. | | no |
50 | IRC_NICKNAME | Set `IRC_NICKNAME` to the IRC nickname which is required to send the notification. It must not be an already registered name as the connection's MODE is defined as a guest. | | yes |
51 | IRC_REALNAME | Set `IRC_REALNAME` to the IRC realname which is required in order to make the connection. | | yes |
52 | [DEFAULT_RECIPIENT_IRC](#option-default-recipient-irc) | You can have different channels per role, by editing `DEFAULT_RECIPIENT_IRC` with the channel you want | | yes |
53
54 <a id="option-nc-path"></a>
55 ##### nc path
56
57 ```sh
58 #------------------------------------------------------------------------------
59 # external commands
60 #
61 # The full path of the nc command.
62 # If empty, the system $PATH will be searched for it.
63 # If not found, irc notifications will be silently disabled.
64 nc="/usr/bin/nc"
65 ```
66
67
68 <a id="option-default-recipient-irc"></a>
69 ##### DEFAULT_RECIPIENT_IRC
70
71 The `DEFAULT_RECIPIENT_IRC` can be edited in the following entries at the bottom of the same file:
72 ```text
73 role_recipients_irc[sysadmin]="#systems"
74 role_recipients_irc[domainadmin]="#domains"
75 role_recipients_irc[dba]="#databases #systems"
76 role_recipients_irc[webmaster]="#marketing #development"
77 role_recipients_irc[proxyadmin]="#proxy-admin"
78 role_recipients_irc[sitemgr]="#sites"
79 ```
80
81
82
83 </details>
84
85
86
87 #### via File
88
89 The configuration file name for this integration is `health_alarm_notify.conf`.
90
91
92 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
93 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
94
95 ```bash
96 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
97 sudo ./edit-config health_alarm_notify.conf
98 ```
99
100 ##### Examples
101
102 ###### Basic Configuration
103
104
105
106 ```yaml
107 #------------------------------------------------------------------------------
108 # irc notification options
109 #
110 SEND_IRC="YES"
111 DEFAULT_RECIPIENT_IRC="#system-alarms"
112 IRC_NETWORK="irc.freenode.net"
113 IRC_NICKNAME="netdata-alarm-user"
114 IRC_REALNAME="netdata-user"
115
116 ```
117
118
119 ## Troubleshooting
120
121 ### Test Notification
122
123 You can run the following command by hand, to test alerts configuration:
124
125 ```bash
126 # become user netdata
127 sudo su -s /bin/bash netdata
128
129 # enable debugging info on the console
130 export NETDATA_ALARM_NOTIFY_DEBUG=1
131
132 # send test alarms to sysadmin
133 /usr/libexec/netdata/plugins.d/alarm-notify.sh test
134
135 # send test alarms to any role
136 /usr/libexec/netdata/plugins.d/alarm-notify.sh test "ROLE"
137 ```
138
139 Note that this will test _all_ alert mechanisms for the selected role.
140
141