@cryptotaxi247 / netdata-1 / commits / d15f36d73

remove python.d/nginx_plus (#13995)

Ilya Mashchenko committed Nov 14, 2022 at 22:37 UTC d15f36d73edbf6538d1814cf7efd8f942b00acfb
6 files changed -752
collectors/python.d.plugin/Makefile.am
-1
@@ -66,7 +66,6 @@ include megacli/Makefile.inc
66 include memcached/Makefile.inc
67 include mongodb/Makefile.inc
68 include monit/Makefile.inc
69 -include nginx_plus/Makefile.inc
69 include nvidia_smi/Makefile.inc
70 include nsd/Makefile.inc
71 include ntpd/Makefile.inc
collectors/python.d.plugin/nginx_plus/Makefile.inc deleted
-13
@@ -1,13 +0,0 @@
1 -# SPDX-License-Identifier: GPL-3.0-or-later
2 -
3 -# THIS IS NOT A COMPLETE Makefile
4 -# IT IS INCLUDED BY ITS PARENT'S Makefile.am
5 -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
6 -
7 -# install these files
8 -dist_python_DATA += nginx_plus/nginx_plus.chart.py
9 -dist_pythonconfig_DATA += nginx_plus/nginx_plus.conf
10 -
11 -# do not install these files, but include them in the distribution
12 -dist_noinst_DATA += nginx_plus/README.md nginx_plus/Makefile.inc
13 -
collectors/python.d.plugin/nginx_plus/README.md deleted
-165
@@ -1,165 +0,0 @@
1 -<!--
2 -title: "NGINX Plus monitoring with Netdata"
3 -custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/python.d.plugin/nginx_plus/README.md
4 -sidebar_label: "NGINX Plus"
5 --->
6 -
7 -# NGINX Plus monitoring with Netdata
8 -
9 -Monitors one or more NGINX Plus servers depending on configuration. Servers can be either local or remote.
10 -
11 -Example nginx_plus configuration can be found in 'python.d/nginx_plus.conf'
12 -
13 -It produces following charts:
14 -
15 -1. **Requests total** in requests/s
16 -
17 - - total
18 -
19 -2. **Requests current** in requests
20 -
21 - - current
22 -
23 -3. **Connection Statistics** in connections/s
24 -
25 - - accepted
26 - - dropped
27 -
28 -4. **Workers Statistics** in workers
29 -
30 - - idle
31 - - active
32 -
33 -5. **SSL Handshakes** in handshakes/s
34 -
35 - - successful
36 - - failed
37 -
38 -6. **SSL Session Reuses** in sessions/s
39 -
40 - - reused
41 -
42 -7. **SSL Memory Usage** in percent
43 -
44 - - usage
45 -
46 -8. **Processes** in processes
47 -
48 - - respawned
49 -
50 -For every server zone:
51 -
52 -1. **Processing** in requests
53 -
54 -- processing
55 -
56 -2. **Requests** in requests/s
57 -
58 - - requests
59 -
60 -3. **Responses** in requests/s
61 -
62 - - 1xx
63 - - 2xx
64 - - 3xx
65 - - 4xx
66 - - 5xx
67 -
68 -4. **Traffic** in kilobits/s
69 -
70 - - received
71 - - sent
72 -
73 -For every upstream:
74 -
75 -1. **Peers Requests** in requests/s
76 -
77 - - peer name (dimension per peer)
78 -
79 -2. **All Peers Responses** in responses/s
80 -
81 - - 1xx
82 - - 2xx
83 - - 3xx
84 - - 4xx
85 - - 5xx
86 -
87 -3. **Peer Responses** in requests/s (for every peer)
88 -
89 - - 1xx
90 - - 2xx
91 - - 3xx
92 - - 4xx
93 - - 5xx
94 -
95 -4. **Peers Connections** in active
96 -
97 - - peer name (dimension per peer)
98 -
99 -5. **Peers Connections Usage** in percent
100 -
101 - - peer name (dimension per peer)
102 -
103 -6. **All Peers Traffic** in KB
104 -
105 - - received
106 - - sent
107 -
108 -7. **Peer Traffic** in KB/s (for every peer)
109 -
110 - - received
111 - - sent
112 -
113 -8. **Peer Timings** in ms (for every peer)
114 -
115 - - header
116 - - response
117 -
118 -9. **Memory Usage** in percent
119 -
120 - - usage
121 -
122 -10. **Peers Status** in state
123 -
124 - - peer name (dimension per peer)
125 -
126 -11. **Peers Total Downtime** in seconds
127 -
128 - - peer name (dimension per peer)
129 -
130 -For every cache:
131 -
132 -1. **Traffic** in KB
133 -
134 - - served
135 - - written
136 - - bypass
137 -
138 -2. **Memory Usage** in percent
139 -
140 - - usage
141 -
142 -## Configuration
143 -
144 -Edit the `python.d/nginx_plus.conf` configuration file using `edit-config` from the Netdata [config
145 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
146 -
147 -```bash
148 -cd /etc/netdata # Replace this path with your Netdata config directory, if different
149 -sudo ./edit-config python.d/nginx_plus.conf
150 -```
151 -
152 -Needs only `url` to server's `status`.
153 -
154 -Here is an example for a local server:
155 -
156 -```yaml
157 -local:
158 - url : 'http://localhost/status'
159 -```
160 -
161 -Without configuration, module fail to start.
162 -
163 ----
164 -
165 -
collectors/python.d.plugin/nginx_plus/nginx_plus.chart.py deleted
-487
@@ -1,487 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: nginx_plus netdata python.d module
3 -# Author: Ilya Mashchenko (ilyam8)
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -import re
7 -
8 -from collections import defaultdict
9 -from copy import deepcopy
10 -from json import loads
11 -
12 -try:
13 - from collections import OrderedDict
14 -except ImportError:
15 - from third_party.ordereddict import OrderedDict
16 -
17 -from bases.FrameworkServices.UrlService import UrlService
18 -
19 -ORDER = [
20 - 'requests_total',
21 - 'requests_current',
22 - 'connections_statistics',
23 - 'connections_workers',
24 - 'ssl_handshakes',
25 - 'ssl_session_reuses',
26 - 'ssl_memory_usage',
27 - 'processes'
28 -]
29 -
30 -CHARTS = {
31 - 'requests_total': {
32 - 'options': [None, 'Requests Total', 'requests/s', 'requests', 'nginx_plus.requests_total', 'line'],
33 - 'lines': [
34 - ['requests_total', 'total', 'incremental']
35 - ]
36 - },
37 - 'requests_current': {
38 - 'options': [None, 'Requests Current', 'requests', 'requests', 'nginx_plus.requests_current', 'line'],
39 - 'lines': [
40 - ['requests_current', 'current']
41 - ]
42 - },
43 - 'connections_statistics': {
44 - 'options': [None, 'Connections Statistics', 'connections/s',
45 - 'connections', 'nginx_plus.connections_statistics', 'stacked'],
46 - 'lines': [
47 - ['connections_accepted', 'accepted', 'incremental'],
48 - ['connections_dropped', 'dropped', 'incremental']
49 - ]
50 - },
51 - 'connections_workers': {
52 - 'options': [None, 'Workers Statistics', 'workers',
53 - 'connections', 'nginx_plus.connections_workers', 'stacked'],
54 - 'lines': [
55 - ['connections_idle', 'idle'],
56 - ['connections_active', 'active']
57 - ]
58 - },
59 - 'ssl_handshakes': {
60 - 'options': [None, 'SSL Handshakes', 'handshakes/s', 'ssl', 'nginx_plus.ssl_handshakes', 'stacked'],
61 - 'lines': [
62 - ['ssl_handshakes', 'successful', 'incremental'],
63 - ['ssl_handshakes_failed', 'failed', 'incremental']
64 - ]
65 - },
66 - 'ssl_session_reuses': {
67 - 'options': [None, 'Session Reuses', 'sessions/s', 'ssl', 'nginx_plus.ssl_session_reuses', 'line'],
68 - 'lines': [
69 - ['ssl_session_reuses', 'reused', 'incremental']
70 - ]
71 - },
72 - 'ssl_memory_usage': {
73 - 'options': [None, 'Memory Usage', 'percentage', 'ssl', 'nginx_plus.ssl_memory_usage', 'area'],
74 - 'lines': [
75 - ['ssl_memory_usage', 'usage', 'absolute', 1, 100]
76 - ]
77 - },
78 - 'processes': {
79 - 'options': [None, 'Processes', 'processes', 'processes', 'nginx_plus.processes', 'line'],
80 - 'lines': [
81 - ['processes_respawned', 'respawned']
82 - ]
83 - }
84 -}
85 -
86 -
87 -def cache_charts(cache):
88 - family = 'cache {0}'.format(cache.real_name)
89 - charts = OrderedDict()
90 -
91 - charts['{0}_traffic'.format(cache.name)] = {
92 - 'options': [None, 'Traffic', 'KiB', family, 'nginx_plus.cache_traffic', 'stacked'],
93 - 'lines': [
94 - ['_'.join([cache.name, 'hit_bytes']), 'served', 'absolute', 1, 1024],
95 - ['_'.join([cache.name, 'miss_bytes_written']), 'written', 'absolute', 1, 1024],
96 - ['_'.join([cache.name, 'miss_bytes']), 'bypass', 'absolute', 1, 1024]
97 - ]
98 - }
99 - charts['{0}_memory_usage'.format(cache.name)] = {
100 - 'options': [None, 'Memory Usage', 'percentage', family, 'nginx_plus.cache_memory_usage', 'area'],
101 - 'lines': [
102 - ['_'.join([cache.name, 'memory_usage']), 'usage', 'absolute', 1, 100],
103 - ]
104 - }
105 - return charts
106 -
107 -
108 -def web_zone_charts(wz):
109 - charts = OrderedDict()
110 - family = 'web zone {name}'.format(name=wz.real_name)
111 -
112 - # Processing
113 - charts['zone_{name}_processing'.format(name=wz.name)] = {
114 - 'options': [None, 'Zone "{name}" Processing'.format(name=wz.name), 'requests', family,
115 - 'nginx_plus.web_zone_processing', 'line'],
116 - 'lines': [
117 - ['_'.join([wz.name, 'processing']), 'processing']
118 - ]
119 - }
120 - # Requests
121 - charts['zone_{name}_requests'.format(name=wz.name)] = {
122 - 'options': [None, 'Zone "{name}" Requests'.format(name=wz.name), 'requests/s', family,
123 - 'nginx_plus.web_zone_requests', 'line'],
124 - 'lines': [
125 - ['_'.join([wz.name, 'requests']), 'requests', 'incremental']
126 - ]
127 - }
128 - # Response Codes
129 - charts['zone_{name}_responses'.format(name=wz.name)] = {
130 - 'options': [None, 'Zone "{name}" Responses'.format(name=wz.name), 'requests/s', family,
131 - 'nginx_plus.web_zone_responses', 'stacked'],
132 - 'lines': [
133 - ['_'.join([wz.name, 'responses_2xx']), '2xx', 'incremental'],
134 - ['_'.join([wz.name, 'responses_5xx']), '5xx', 'incremental'],
135 - ['_'.join([wz.name, 'responses_3xx']), '3xx', 'incremental'],
136 - ['_'.join([wz.name, 'responses_4xx']), '4xx', 'incremental'],
137 - ['_'.join([wz.name, 'responses_1xx']), '1xx', 'incremental']
138 - ]
139 - }
140 - # Traffic
141 - charts['zone_{name}_net'.format(name=wz.name)] = {
142 - 'options': [None, 'Zone "{name}" Traffic'.format(name=wz.name), 'kilobits/s', family,
143 - 'nginx_plus.zone_net', 'area'],
144 - 'lines': [
145 - ['_'.join([wz.name, 'received']), 'received', 'incremental', 1, 1000],
146 - ['_'.join([wz.name, 'sent']), 'sent', 'incremental', -1, 1000]
147 - ]
148 - }
149 - return charts
150 -
151 -
152 -def web_upstream_charts(wu):
153 - def dimensions(value, a='absolute', m=1, d=1):
154 - dims = list()
155 - for p in wu:
156 - dims.append(['_'.join([wu.name, p.server, value]), p.real_server, a, m, d])
157 - return dims
158 -
159 - charts = OrderedDict()
160 - family = 'web upstream {name}'.format(name=wu.real_name)
161 -
162 - # Requests
163 - charts['web_upstream_{name}_requests'.format(name=wu.name)] = {
164 - 'options': [None, 'Peers Requests', 'requests/s', family, 'nginx_plus.web_upstream_requests', 'line'],
165 - 'lines': dimensions('requests', 'incremental')
166 - }
167 - # Responses Codes
168 - charts['web_upstream_{name}_all_responses'.format(name=wu.name)] = {
169 - 'options': [None, 'All Peers Responses', 'responses/s', family,
170 - 'nginx_plus.web_upstream_all_responses', 'stacked'],
171 - 'lines': [
172 - ['_'.join([wu.name, 'responses_2xx']), '2xx', 'incremental'],
173 - ['_'.join([wu.name, 'responses_5xx']), '5xx', 'incremental'],
174 - ['_'.join([wu.name, 'responses_3xx']), '3xx', 'incremental'],
175 - ['_'.join([wu.name, 'responses_4xx']), '4xx', 'incremental'],
176 - ['_'.join([wu.name, 'responses_1xx']), '1xx', 'incremental'],
177 - ]
178 - }
179 - for peer in wu:
180 - charts['web_upstream_{0}_{1}_responses'.format(wu.name, peer.server)] = {
181 - 'options': [None, 'Peer "{0}" Responses'.format(peer.real_server), 'responses/s', family,
182 - 'nginx_plus.web_upstream_peer_responses', 'stacked'],
183 - 'lines': [
184 - ['_'.join([wu.name, peer.server, 'responses_2xx']), '2xx', 'incremental'],
185 - ['_'.join([wu.name, peer.server, 'responses_5xx']), '5xx', 'incremental'],
186 - ['_'.join([wu.name, peer.server, 'responses_3xx']), '3xx', 'incremental'],
187 - ['_'.join([wu.name, peer.server, 'responses_4xx']), '4xx', 'incremental'],
188 - ['_'.join([wu.name, peer.server, 'responses_1xx']), '1xx', 'incremental']
189 - ]
190 - }
191 - # Connections
192 - charts['web_upstream_{name}_connections'.format(name=wu.name)] = {
193 - 'options': [None, 'Peers Connections', 'active', family, 'nginx_plus.web_upstream_connections', 'line'],
194 - 'lines': dimensions('active')
195 - }
196 - charts['web_upstream_{name}_connections_usage'.format(name=wu.name)] = {
197 - 'options': [None, 'Peers Connections Usage', 'percentage', family,
198 - 'nginx_plus.web_upstream_connections_usage', 'line'],
199 - 'lines': dimensions('connections_usage', d=100)
200 - }
201 - # Traffic
202 - charts['web_upstream_{0}_all_net'.format(wu.name)] = {
203 - 'options': [None, 'All Peers Traffic', 'kilobits/s', family, 'nginx_plus.web_upstream_all_net', 'area'],
204 - 'lines': [
205 - ['{0}_received'.format(wu.name), 'received', 'incremental', 1, 1000],
206 - ['{0}_sent'.format(wu.name), 'sent', 'incremental', -1, 1000]
207 - ]
208 - }
209 - for peer in wu:
210 - charts['web_upstream_{0}_{1}_net'.format(wu.name, peer.server)] = {
211 - 'options': [None, 'Peer "{0}" Traffic'.format(peer.real_server), 'kilobits/s', family,
212 - 'nginx_plus.web_upstream_peer_traffic', 'area'],
213 - 'lines': [
214 - ['{0}_{1}_received'.format(wu.name, peer.server), 'received', 'incremental', 1, 1000],
215 - ['{0}_{1}_sent'.format(wu.name, peer.server), 'sent', 'incremental', -1, 1000]
216 - ]
217 - }
218 - # Response Time
219 - for peer in wu:
220 - charts['web_upstream_{0}_{1}_timings'.format(wu.name, peer.server)] = {
221 - 'options': [None, 'Peer "{0}" Timings'.format(peer.real_server), 'milliseconds', family,
222 - 'nginx_plus.web_upstream_peer_timings', 'line'],
223 - 'lines': [
224 - ['_'.join([wu.name, peer.server, 'header_time']), 'header'],
225 - ['_'.join([wu.name, peer.server, 'response_time']), 'response']
226 - ]
227 - }
228 - # Memory Usage
229 - charts['web_upstream_{name}_memory_usage'.format(name=wu.name)] = {
230 - 'options': [None, 'Memory Usage', 'percentage', family, 'nginx_plus.web_upstream_memory_usage', 'area'],
231 - 'lines': [
232 - ['_'.join([wu.name, 'memory_usage']), 'usage', 'absolute', 1, 100]
233 - ]
234 - }
235 - # State
236 - charts['web_upstream_{name}_status'.format(name=wu.name)] = {
237 - 'options': [None, 'Peers Status', 'state', family, 'nginx_plus.web_upstream_status', 'line'],
238 - 'lines': dimensions('state')
239 - }
240 - # Downtime
241 - charts['web_upstream_{name}_downtime'.format(name=wu.name)] = {
242 - 'options': [None, 'Peers Downtime', 'seconds', family, 'nginx_plus.web_upstream_peer_downtime', 'line'],
243 - 'lines': dimensions('downtime', d=1000)
244 - }
245 -
246 - return charts
247 -
248 -
249 -METRICS = {
250 - 'SERVER': [
251 - 'processes.respawned',
252 - 'connections.accepted',
253 - 'connections.dropped',
254 - 'connections.active',
255 - 'connections.idle',
256 - 'ssl.handshakes',
257 - 'ssl.handshakes_failed',
258 - 'ssl.session_reuses',
259 - 'requests.total',
260 - 'requests.current',
261 - 'slabs.SSL.pages.free',
262 - 'slabs.SSL.pages.used'
263 - ],
264 - 'WEB_ZONE': [
265 - 'processing',
266 - 'requests',
267 - 'responses.1xx',
268 - 'responses.2xx',
269 - 'responses.3xx',
270 - 'responses.4xx',
271 - 'responses.5xx',
272 - 'discarded',
273 - 'received',
274 - 'sent'
275 - ],
276 - 'WEB_UPSTREAM_PEER': [
277 - 'id',
278 - 'server',
279 - 'name',
280 - 'state',
281 - 'active',
282 - 'max_conns',
283 - 'requests',
284 - 'header_time', # alive only
285 - 'response_time', # alive only
286 - 'responses.1xx',
287 - 'responses.2xx',
288 - 'responses.3xx',
289 - 'responses.4xx',
290 - 'responses.5xx',
291 - 'sent',
292 - 'received',
293 - 'downtime'
294 - ],
295 - 'WEB_UPSTREAM_SUMMARY': [
296 - 'responses.1xx',
297 - 'responses.2xx',
298 - 'responses.3xx',
299 - 'responses.4xx',
300 - 'responses.5xx',
301 - 'sent',
302 - 'received'
303 - ],
304 - 'CACHE': [
305 - 'hit.bytes', # served
306 - 'miss.bytes_written', # written
307 - 'miss.bytes' # bypass
308 -
309 - ]
310 -}
311 -
312 -BAD_SYMBOLS = re.compile(r'[:/.-]+')
313 -
314 -
315 -class Cache:
316 - key = 'caches'
317 - charts = cache_charts
318 -
319 - def __init__(self, **kw):
320 - self.real_name = kw['name']
321 - self.name = BAD_SYMBOLS.sub('_', self.real_name)
322 -
323 - def memory_usage(self, data):
324 - used = data['slabs'][self.real_name]['pages']['used']
325 - free = data['slabs'][self.real_name]['pages']['free']
326 - return used / float(free + used) * 1e4
327 -
328 - def get_data(self, raw_data):
329 - zone_data = raw_data['caches'][self.real_name]
330 - data = parse_json(zone_data, METRICS['CACHE'])
331 - data['memory_usage'] = self.memory_usage(raw_data)
332 - return dict(('_'.join([self.name, k]), v) for k, v in data.items())
333 -
334 -
335 -class WebZone:
336 - key = 'server_zones'
337 - charts = web_zone_charts
338 -
339 - def __init__(self, **kw):
340 - self.real_name = kw['name']
341 - self.name = BAD_SYMBOLS.sub('_', self.real_name)
342 -
343 - def get_data(self, raw_data):
344 - zone_data = raw_data['server_zones'][self.real_name]
345 - data = parse_json(zone_data, METRICS['WEB_ZONE'])
346 - return dict(('_'.join([self.name, k]), v) for k, v in data.items())
347 -
348 -
349 -class WebUpstream:
350 - key = 'upstreams'
351 - charts = web_upstream_charts
352 -
353 - def __init__(self, **kw):
354 - self.real_name = kw['name']
355 - self.name = BAD_SYMBOLS.sub('_', self.real_name)
356 - self.peers = OrderedDict()
357 -
358 - peers = kw['response']['upstreams'][self.real_name]['peers']
359 - for peer in peers:
360 - self.add_peer(peer['id'], peer['server'])
361 -
362 - def __iter__(self):
363 - return iter(self.peers.values())
364 -
365 - def add_peer(self, idx, server):
366 - peer = WebUpstreamPeer(idx, server)
367 - self.peers[peer.real_server] = peer
368 - return peer
369 -
370 - def peers_stats(self, peers):
371 - peers = {int(peer['id']): peer for peer in peers}
372 - data = dict()
373 - for peer in self.peers.values():
374 - if not peer.active:
375 - continue
376 - try:
377 - data.update(peer.get_data(peers[peer.id]))
378 - except KeyError:
379 - peer.active = False
380 - return data
381 -
382 - def memory_usage(self, data):
383 - used = data['slabs'][self.real_name]['pages']['used']
384 - free = data['slabs'][self.real_name]['pages']['free']
385 - return used / float(free + used) * 1e4
386 -
387 - def summary_stats(self, data):
388 - rv = defaultdict(int)
389 - for metric in METRICS['WEB_UPSTREAM_SUMMARY']:
390 - for peer in self.peers.values():
391 - if peer.active:
392 - metric = '_'.join(metric.split('.'))
393 - rv[metric] += data['_'.join([peer.server, metric])]
394 - return rv
395 -
396 - def get_data(self, raw_data):
397 - data = dict()
398 - peers = raw_data['upstreams'][self.real_name]['peers']
399 - data.update(self.peers_stats(peers))
400 - data.update(self.summary_stats(data))
401 - data['memory_usage'] = self.memory_usage(raw_data)
402 - return dict(('_'.join([self.name, k]), v) for k, v in data.items())
403 -
404 -
405 -class WebUpstreamPeer:
406 - def __init__(self, idx, server):
407 - self.id = idx
408 - self.real_server = server
409 - self.server = BAD_SYMBOLS.sub('_', self.real_server)
410 - self.active = True
411 -
412 - def get_data(self, raw):
413 - data = dict(header_time=0, response_time=0, max_conns=0)
414 - data.update(parse_json(raw, METRICS['WEB_UPSTREAM_PEER']))
415 - data['connections_usage'] = 0 if not data['max_conns'] else data['active'] / float(data['max_conns']) * 1e4
416 - data['state'] = int(data['state'] == 'up')
417 - return dict(('_'.join([self.server, k]), v) for k, v in data.items())
418 -
419 -
420 -class Service(UrlService):
421 - def __init__(self, configuration=None, name=None):
422 - UrlService.__init__(self, configuration=configuration, name=name)
423 - self.order = list(ORDER)
424 - self.definitions = deepcopy(CHARTS)
425 - self.objects = dict()
426 -
427 - def check(self):
428 - if not self.url:
429 - self.error('URL is not defined')
430 - return None
431 -
432 - self._manager = self._build_manager()
433 - if not self._manager:
434 - return None
435 -
436 - raw_data = self._get_raw_data()
437 - if not raw_data:
438 - return None
439 -
440 - try:
441 - response = loads(raw_data)
442 - except ValueError:
443 - return None
444 -
445 - for obj_cls in [WebZone, WebUpstream, Cache]:
446 - for obj_name in response.get(obj_cls.key, list()):
447 - obj = obj_cls(name=obj_name, response=response)
448 - self.objects[obj.real_name] = obj
449 - charts = obj_cls.charts(obj)
450 - for chart in charts:
451 - self.order.append(chart)
452 - self.definitions[chart] = charts[chart]
453 -
454 - return bool(self.objects)
455 -
456 - def _get_data(self):
457 - """
458 - Format data received from http request
459 - :return: dict
460 - """
461 - raw_data = self._get_raw_data()
462 - if not raw_data:
463 - return None
464 - response = loads(raw_data)
465 -
466 - data = parse_json(response, METRICS['SERVER'])
467 - data['ssl_memory_usage'] = data['slabs_SSL_pages_used'] / float(data['slabs_SSL_pages_free']) * 1e4
468 -
469 - for obj in self.objects.values():
470 - if obj.real_name in response[obj.key]:
471 - data.update(obj.get_data(response))
472 -
473 - return data
474 -
475 -
476 -def parse_json(raw_data, metrics):
477 - data = dict()
478 - for metric in metrics:
479 - value = raw_data
480 - metrics_list = metric.split('.')
481 - try:
482 - for m in metrics_list:
483 - value = value[m]
484 - except KeyError:
485 - continue
486 - data['_'.join(metrics_list)] = value
487 - return data
collectors/python.d.plugin/nginx_plus/nginx_plus.conf deleted
-85
@@ -1,85 +0,0 @@
1 -# netdata python.d.plugin configuration for nginx_plus
2 -#
3 -# This file is in YaML format. Generally the format is:
4 -#
5 -# name: value
6 -#
7 -# There are 2 sections:
8 -# - global variables
9 -# - one or more JOBS
10 -#
11 -# JOBS allow you to collect values from multiple sources.
12 -# Each source will have its own set of charts.
13 -#
14 -# JOB parameters have to be indented (using spaces only, example below).
15 -
16 -# ----------------------------------------------------------------------
17 -# Global Variables
18 -# These variables set the defaults for all JOBs, however each JOB
19 -# may define its own, overriding the defaults.
20 -
21 -# update_every sets the default data collection frequency.
22 -# If unset, the python.d.plugin default is used.
23 -# update_every: 1
24 -
25 -# priority controls the order of charts at the netdata dashboard.
26 -# Lower numbers move the charts towards the top of the page.
27 -# If unset, the default for python.d.plugin is used.
28 -# priority: 60000
29 -
30 -# penalty indicates whether to apply penalty to update_every in case of failures.
31 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
32 -# penalty: yes
33 -
34 -# autodetection_retry sets the job re-check interval in seconds.
35 -# The job is not deleted if check fails.
36 -# Attempts to start the job are made once every autodetection_retry.
37 -# This feature is disabled by default.
38 -# autodetection_retry: 0
39 -
40 -# ----------------------------------------------------------------------
41 -# JOBS (data collection sources)
42 -#
43 -# The default JOBS share the same *name*. JOBS with the same name
44 -# are mutually exclusive. Only one of them will be allowed running at
45 -# any time. This allows autodetection to try several alternatives and
46 -# pick the one that works.
47 -#
48 -# Any number of jobs is supported.
49 -#
50 -# All python.d.plugin JOBS (for all its modules) support a set of
51 -# predefined parameters. These are:
52 -#
53 -# job_name:
54 -# name: myname # the JOB's name as it will appear at the
55 -# # dashboard (by default is the job_name)
56 -# # JOBs sharing a name are mutually exclusive
57 -# update_every: 1 # the JOB's data collection frequency
58 -# priority: 60000 # the JOB's order on the dashboard
59 -# penalty: yes # the JOB's penalty
60 -# autodetection_retry: 0 # the JOB's re-check interval in seconds
61 -#
62 -# Additionally to the above, nginx_plus also supports the following:
63 -#
64 -# url: 'URL' # the URL to fetch nginx_plus's stats
65 -#
66 -# if the URL is password protected, the following are supported:
67 -#
68 -# user: 'username'
69 -# pass: 'password'
70 -
71 -# ----------------------------------------------------------------------
72 -# AUTO-DETECTION JOBS
73 -# only one of them will run (they have the same name)
74 -
75 -localhost:
76 - name : 'local'
77 - url : 'http://localhost/status'
78 -
79 -localipv4:
80 - name : 'local'
81 - url : 'http://127.0.0.1/status'
82 -
83 -localipv6:
84 - name : 'local'
85 - url : 'http://[::1]/status'
collectors/python.d.plugin/python.d.conf
-1
@@ -56,7 +56,6 @@ logind: no
56 # memcached: yes
57 # mongodb: yes
58 # monit: yes
59 -# nginx_plus: yes
59 # nvidia_smi: yes
60 # nsd: yes
61 # ntpd: yes