@cryptotaxi247 / netdata-1 / commits / 300575a16

feat(statsd.plugin): add Asterisk configuration file with synthetic charts (#12381)

Ilya Mashchenko committed Mar 18, 2022 at 19:38 UTC 300575a1680b1fab2f294bb231f5ae2ab8e1e7f5
4 files changed +274
collectors/statsd.plugin/Makefile.am
+1
@@ -11,6 +11,7 @@ statsdconfigdir=$(libconfigdir)/statsd.d
11 dist_statsdconfig_DATA = \
12 example.conf \
13 k6.conf \
14 + asterisk.conf \
15 $(NULL)
16
17 userstatsdconfigdir=$(configdir)/statsd.d
collectors/statsd.plugin/README.md
+4
@@ -27,6 +27,10 @@ On these charts, we can have alarms as with any metric and chart.
27 - **Description:** k6 is a developer-centric, free and open-source load testing tool built for making performance testing a productive and enjoyable experience.
28 - [Documentation](/collectors/statsd.plugin/k6.md)
29 - [Configuration](https://github.com/netdata/netdata/blob/master/collectors/statsd.plugin/k6.conf)
30 +- [Asterisk](https://www.asterisk.org/)
31 + - **Description:** Asterisk is an Open Source PBX and telephony toolkit.
32 + - [Documentation](/collectors/statsd.plugin/asterisk.md)
33 + - [Configuration](https://github.com/netdata/netdata/blob/master/collectors/statsd.plugin/asterisk.conf)
34
35 ## Metrics supported by Netdata
36
collectors/statsd.plugin/asterisk.conf new
+208
@@ -0,0 +1,208 @@
1 +[app]
2 + name = asterisk
3 + metrics = asterisk.*
4 + private charts = yes
5 + gaps when not collected = no
6 +
7 +[dictionary]
8 + # https://www.voip-info.org/asterisk-variable-hangupcause/
9 + q931.1 = unallocated 1
10 + q931.2 = no route transit net 2
11 + q931.3 = no route destination 3
12 + q931.6 = channel unacceptable 6
13 + q931.7 = call awarded delivered 7
14 + q931.16 = normal 16
15 + q931.17 = busy 17
16 + q931.18 = no response 18
17 + q931.19 = no answer 19
18 + q931.21 = rejected call 21
19 + q931.22 = number changed 22
20 + q931.27 = dst out of order 27
21 + q931.28 = invalid number 28
22 + q931.29 = rejected facility 29
23 + q931.30 = response to status 30
24 + q931.31 = normal unspecified 31
25 + q931.34 = congestion circuit 34
26 + q931.38 = net out of order 38
27 + q931.41 = normal tmp fail 41
28 + q931.42 = congestion switch 42
29 + q931.43 = access info discarded 43
30 + q931.44 = requested chan unavail 44
31 + q931.45 = pre empted 45
32 + q931.47 = resource unavailable, unspecified 47
33 + q931.50 = facility not subscribed 50
34 + q931.52 = outgoing call barred 52
35 + q931.54 = incoming call barred 54
36 + q931.57 = bearer capability not auth 57
37 + q931.58 = bearer capability not avail 58
38 + q931.65 = bearer capability not implemented 65
39 + q931.66 = chan not implemented 66
40 + q931.69 = facility not implemented 67
41 + q931.81 = invalid call reference 81
42 + q931.88 = incompatible destination 88
43 + q931.95 = invalid msg specified 95
44 + q931.96 = mandatory ie missing 96
45 + q931.97 = message type non exist 97
46 + q931.98 = wrong message 98
47 + q931.99 = ie non exist 99
48 + q931.100 = invalid ie contents 100
49 + q931.101 = wrong call state 101
50 + q931.102 = recovery on timer expire 102
51 + q931.103 = mandatory ie length error 103
52 + q931.111 = protocol error 111
53 + q931.127 = interworking 127
54 +
55 +
56 +[channels]
57 + name = channels
58 + title = Active Channels
59 + family = channels
60 + context = asterisk.channels
61 + units = channels
62 + priority = 91000
63 + type = stacked
64 + dimension = pattern asterisk.channels.count 'channels' last 1 1
65 + # FIXME: netdata needs to prevent this from going negative
66 +
67 +[endpoints]
68 + name = endpoints
69 + title = Active Endpoints
70 + family = endpoints
71 + context = asterisk.endpoints
72 + units = endpoints
73 + priority = 91005
74 + type = stacked
75 + dimension = pattern asterisk.endpoints.count 'endpoints' last 1 1
76 +
77 +[endpoints_by_status]
78 + name = endpoints_by_status
79 + title = Active Endpoints by Status
80 + family = endpoints
81 + context = asterisk.endpoints_by_status
82 + units = endpoints
83 + priority = 91006
84 + type = stacked
85 + dimension = pattern asterisk.endpoints.state.* '' last 1 1
86 +
87 +[sip_channels_by_endpoint]
88 + name = sip_channels_by_endpoint
89 + title = Active SIP channels by endpoint
90 + family = channels
91 + context = asterisk.sip_channels_by_endpoint
92 + units = channels
93 + priority = 91110
94 + type = stacked
95 + dimension = pattern asterisk.endpoints.SIP.*.channels '' last 1 1
96 +
97 +[pjsip_channels_by_endpoint]
98 + name = pjsip_channels_by_endpoint
99 + title = Active PJSIP channels by endpoint
100 + family = channels
101 + context = asterisk.pjsip_channels_by_endpoint
102 + units = channels
103 + priority = 91111
104 + type = stacked
105 + dimension = pattern asterisk.endpoints.PJSIP.*.channels '' last 1 1
106 +
107 +[dialstatuses]
108 + name = dialstatuses
109 + title = Distribution of Dial Statuses
110 + family = dial_statuses
111 + context = asterisk.dialstatus
112 + units = calls
113 + priority = 91150
114 + type = stacked
115 + dimension = pattern 'asterisk.dialstatus.*' '' last 1 1
116 +
117 +[calltime]
118 + name = calltime
119 + title = Asterisk Channels Call Duration
120 + family = calltime
121 + context = asterisk.calltime
122 + units = milliseconds
123 + priority = 91160
124 + type = stacked
125 + dimension = asterisk.channels.calltime 'calltime' average 1 1
126 + dimension = asterisk.channels.calltime 'sum' sum 1 1 hidden
127 + dimension = asterisk.channels.calltime 'count' events 1 1 hidden
128 +
129 +[hangupcause]
130 + name = hangupcause
131 + title = Distribution of Hangup Causes
132 + family = hangup_causes
133 + context = asterisk.hangupcause
134 + units = calls
135 + priority = 91200
136 + type = stacked
137 + dimension = pattern 'asterisk.hangupcause.*' 'q931.' last 1 1
138 +
139 +[hangupcause_answer]
140 + name = hangupcause_answer
141 + title = Distribution of Hangup Causes for ANSWERed calls
142 + family = hangup_causes
143 + context = asterisk.hangupcause_answer
144 + units = calls
145 + priority = 91210
146 + type = stacked
147 + dimension = pattern 'asterisk.dialhangupcause.ANSWER.*' 'q931.' last 1 1
148 +
149 +[hangupcause_busy]
150 + name = hangupcause_busy
151 + title = Distribution of Hangup Causes for BUSY calls
152 + family = hangup_causes
153 + context = asterisk.hangupcause_busy
154 + units = calls
155 + priority = 91215
156 + type = stacked
157 + dimension = pattern 'asterisk.dialhangupcause.BUSY.*' 'q931.' last 1 1
158 +
159 +[hangupcause_cancel]
160 + name = hangupcause_cancel
161 + title = Distribution of Hangup Causes for CANCELled calls
162 + family = hangup_causes
163 + context = asterisk.hangupcause_cancel
164 + units = calls
165 + priority = 91220
166 + type = stacked
167 + dimension = pattern 'asterisk.dialhangupcause.CANCEL.*' 'q931.' last 1 1
168 +
169 +[hangupcause_chanunavail]
170 + name = hangupcause_chanunavail
171 + title = Distribution of Hangup Causes for CHANUNVAILed calls
172 + family = hangup_causes
173 + context = asterisk.hangupcause_chanunavail
174 + units = calls
175 + priority = 91230
176 + type = stacked
177 + dimension = pattern 'asterisk.dialhangupcause.CHANUNAVAIL.*' 'q931.' last 1 1
178 +
179 +[hangupcause_congestion]
180 + name = hangupcause_congestion
181 + title = Distribution of Hangup Causes for CONGESTIONed calls
182 + family = hangup_causes
183 + context = asterisk.hangupcause_congestion
184 + units = calls
185 + priority = 91240
186 + type = stacked
187 + dimension = pattern 'asterisk.dialhangupcause.CONGESTION.*' 'q931.' last 1 1
188 +
189 +[events]
190 + name = events
191 + title = Asterisk Dialplan Events
192 + family = events
193 + context = asterisk.events
194 + units = events/s
195 + priority = 91400
196 + type = stacked
197 + dimension = pattern 'asterisk.stasis.message.ast_channel_*_type' '' last 1 1
198 +
199 +[qualify]
200 + name = qualify
201 + title = Asterisk PJSIP Peers Qualify
202 + family = qualify
203 + context = asterisk.qualify
204 + units = milliseconds
205 + priority = 91500
206 + type = stacked
207 + dimension = pattern 'asterisk.PJSIP.contacts.*.rtt' '' max 1 1
208 + # FIXME: netdata needs to set update every = 15 on this
collectors/statsd.plugin/asterisk.md new
+61
@@ -0,0 +1,61 @@
1 +<!--
2 +title: "Asterisk monitoring with Netdata"
3 +custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/statsd.plugin/asterisk.md
4 +
5 +sidebar_label: "Asterisk"
6 +-->
7 +
8 +# Asterisk monitoring with Netdata
9 +
10 +Monitors [Asterisk](https://www.asterisk.org/) dialplan application's statistics.
11 +
12 +## Requirements
13 +
14 +- Asterisk [integrated with StatsD](https://www.asterisk.org/integrating-asterisk-with-statsd/).
15 +
16 +## Configuration
17 +
18 +Netdata ships
19 +with [asterisk.conf](https://github.com/netdata/netdata/blob/master/collectors/statsd.plugin/asterisk.conf) with
20 +preconfigured charts.
21 +
22 +To receive Asterisk metrics in Netdata, uncomment the following lines in the `/etc/asterisk/statsd.conf` file:
23 +
24 +```ini
25 +[general]
26 +enabled = yes ; When set to yes, statsd support is enabled
27 +server = 127.0.0.1 ; server[:port] of statsd server to use.
28 + ; If not specified, the port is 8125
29 +prefix = asterisk ; Prefix to prepend to all metrics
30 +```
31 +
32 +> See [statsd.conf.sample](https://github.com/asterisk/asterisk/blob/master/configs/samples/statsd.conf.sample) for all available options.
33 +
34 +## Charts and metrics
35 +
36 +<details><summary>Click to see screenshots of the charts.</summary>
37 +
38 +![image](https://user-images.githubusercontent.com/2662304/158055351-fcc7a7fb-9b95-4656-bdc6-2e5f5a909215.png)
39 +![image](https://user-images.githubusercontent.com/2662304/158055367-cfd25cd5-d71a-4bab-8cd1-bfcc47bc7312.png)
40 +
41 +</details>
42 +
43 +Mapping Asterisk StatsD metrics and Netdata charts.
44 +
45 +| Chart | Metrics |
46 +|------------------------------------------------------|--------------------------------------------|
47 +| Active Channels | asterisk.channels.count |
48 +| Active Endpoints | asterisk.endpoints.count |
49 +| Active Endpoints by Status | asterisk.endpoints.state.* |
50 +| Active SIP channels by endpoint | asterisk.endpoints.SIP.*.channels |
51 +| Active PJSIP channels by endpoint | asterisk.endpoints.PJSIP.*.channels |
52 +| Distribution of Dial Statuses | asterisk.dialstatus.* |
53 +| Asterisk Channels Call Duration | asterisk.channels.calltime |
54 +| Distribution of Hangup Causes | asterisk.hangupcause.* |
55 +| Distribution of Hangup Causes for ANSWERed calls | asterisk.dialhangupcause.ANSWER.* |
56 +| Distribution of Hangup Causes for BUSY calls | asterisk.dialhangupcause.BUSY.* |
57 +| Distribution of Hangup Causes for CANCELled calls | asterisk.dialhangupcause.CANCEL.* |
58 +| Distribution of Hangup Causes for CHANUNVAILed calls | asterisk.dialhangupcause.CHANUNAVAIL.* |
59 +| Distribution of Hangup Causes for CONGESTIONed calls | asterisk.dialhangupcause.CONGESTION.* |
60 +| Asterisk Dialplan Events | asterisk.stasis.message.ast_channel_*_type |
61 +| Asterisk PJSIP Peers Qualify | asterisk.PJSIP.contacts.*.rtt |