@cryptotaxi247 / netdata-1 / commits / 97b32703c

[python] make units compliant with IEC standard (#4995)

* apache units fix * beanstalk * bind_rndc * boinc * ceph * chrony * couchdb * dns_query * dnsdist * dockerd * dovecot * elasticsearch by @vlvkobal <3 * example * exim * fail2ban * freeradius minor fixes * freeradius minor fixes * freeradius minor fixes * go_expvar * haproxy * hddtemp * httpcheck * icecast * ipfs * isc_dhcpd * litespeed * logind * megacli * memcached * mongodb * monit * mysql * nginx * nginx_plus * nsd * ntpd * nvidia_smi * openldap * ovpn_status * phpfm * portcheck * postfix * postgres * powerdns * proxysql * puppet * rabbitmq * redis * restroshare * samba * sensors * smartdlog * spigotmc * springboot * squid * retroshare * tomcat * retroshare * tor * traefik * traefik * unbound * uwsgi * varnish * w1sensor * web_log * ok codacy * retroshare * ipfs

Ilya Mashchenko committed Dec 17, 2018 at 18:50 UTC 97b32703c63569812ef6652d8a8ab3a75f21990d
62 files changed +747 -580
collectors/python.d.plugin/apache/apache.chart.py
+70 -41
@@ -5,63 +5,60 @@
5
6 from bases.FrameworkServices.UrlService import UrlService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 2
10 -priority = 60000
8
12 -# default job configuration (overridden by python.d.plugin)
13 -# config = {'local': {
14 -# 'update_every': update_every,
15 -# 'retries': retries,
16 -# 'priority': priority,
17 -# 'url': 'http://www.apache.org/server-status?auto'
18 -# }}
19 -
20 -# charts order (can be overridden if you want less charts, or different order)
21 -ORDER = ['requests', 'connections', 'conns_async', 'net', 'workers', 'reqpersec', 'bytespersec', 'bytesperreq']
9 +ORDER = [
10 + 'requests',
11 + 'connections',
12 + 'conns_async',
13 + 'net',
14 + 'workers',
15 + 'reqpersec',
16 + 'bytespersec',
17 + 'bytesperreq',
18 +]
19
20 CHARTS = {
21 'bytesperreq': {
25 - 'options': [None, 'apache Lifetime Avg. Response Size', 'bytes/request',
22 + 'options': [None, 'Lifetime Avg. Request Size', 'KiB',
23 'statistics', 'apache.bytesperreq', 'area'],
24 'lines': [
28 - ['size_req']
25 + ['size_req', 'size', 'absolute', 1, 1024 * 100000]
26 ]},
27 'workers': {
31 - 'options': [None, 'apache Workers', 'workers', 'workers', 'apache.workers', 'stacked'],
28 + 'options': [None, 'Workers', 'workers', 'workers', 'apache.workers', 'stacked'],
29 'lines': [
30 ['idle'],
31 ['busy'],
32 ]},
33 'reqpersec': {
37 - 'options': [None, 'apache Lifetime Avg. Requests/s', 'requests/s', 'statistics',
34 + 'options': [None, 'Lifetime Avg. Requests/s', 'requests/s', 'statistics',
35 'apache.reqpersec', 'area'],
36 'lines': [
40 - ['requests_sec']
37 + ['requests_sec', 'requests', 'absolute', 1, 100000]
38 ]},
39 'bytespersec': {
43 - 'options': [None, 'apache Lifetime Avg. Bandwidth/s', 'kilobits/s', 'statistics',
40 + 'options': [None, 'Lifetime Avg. Bandwidth/s', 'kilobits/s', 'statistics',
41 'apache.bytesperreq', 'area'],
42 'lines': [
46 - ['size_sec', None, 'absolute', 8, 1000]
43 + ['size_sec', None, 'absolute', 8, 1000 * 100000]
44 ]},
45 'requests': {
49 - 'options': [None, 'apache Requests', 'requests/s', 'requests', 'apache.requests', 'line'],
46 + 'options': [None, 'Requests', 'requests/s', 'requests', 'apache.requests', 'line'],
47 'lines': [
48 ['requests', None, 'incremental']
49 ]},
50 'net': {
54 - 'options': [None, 'apache Bandwidth', 'kilobits/s', 'bandwidth', 'apache.net', 'area'],
51 + 'options': [None, 'Bandwidth', 'kilobits/s', 'bandwidth', 'apache.net', 'area'],
52 'lines': [
53 ['sent', None, 'incremental', 8, 1]
54 ]},
55 'connections': {
59 - 'options': [None, 'apache Connections', 'connections', 'connections', 'apache.connections', 'line'],
56 + 'options': [None, 'Connections', 'connections', 'connections', 'apache.connections', 'line'],
57 'lines': [
58 ['connections']
59 ]},
60 'conns_async': {
64 - 'options': [None, 'apache Async Connections', 'connections', 'connections', 'apache.conns_async', 'stacked'],
61 + 'options': [None, 'Async Connections', 'connections', 'connections', 'apache.conns_async', 'stacked'],
62 'lines': [
63 ['keepalive'],
64 ['closing'],
@@ -85,6 +82,14 @@ ASSIGNMENT = {
82 'ConnsAsyncWriting': 'writing'
83 }
84
85 +FLOAT_VALUES = [
86 + 'BytesPerReq',
87 + 'ReqPerSec',
88 + 'BytesPerSec',
89 +]
90 +
91 +LIGHTTPD_MARKER = 'idle_servers'
92 +
93
94 class Service(UrlService):
95 def __init__(self, configuration=None, name=None):
@@ -95,20 +100,15 @@ class Service(UrlService):
100
101 def check(self):
102 self._manager = self._build_manager()
103 +
104 data = self._get_data()
105 +
106 if not data:
107 return None
108
102 - if 'idle_servers' in data:
103 - self.module_name = 'lighttpd'
104 - for chart in self.definitions:
105 - if chart == 'workers':
106 - lines = self.definitions[chart]['lines']
107 - lines[0] = ['idle_servers', 'idle']
108 - lines[1] = ['busy_servers', 'busy']
109 - opts = self.definitions[chart]['options']
110 - opts[1] = opts[1].replace('apache', 'lighttpd')
111 - opts[4] = opts[4].replace('apache', 'lighttpd')
109 + if LIGHTTPD_MARKER in data:
110 + self.turn_into_lighttpd()
111 +
112 return True
113
114 def _get_data(self):
@@ -117,15 +117,44 @@ class Service(UrlService):
117 :return: dict
118 """
119 raw_data = self._get_raw_data()
120 +
121 if not raw_data:
122 return None
123 +
124 data = dict()
125
124 - for row in raw_data.split('\n'):
125 - tmp = row.split(':')
126 - if tmp[0] in ASSIGNMENT:
127 - try:
128 - data[ASSIGNMENT[tmp[0]]] = int(float(tmp[1]))
129 - except (IndexError, ValueError):
130 - continue
126 + for line in raw_data.split('\n'):
127 + try:
128 + parse_line(line, data)
129 + except ValueError:
130 + continue
131 +
132 return data or None
133 +
134 + def turn_into_lighttpd(self):
135 + self.module_name = 'lighttpd'
136 + for chart in self.definitions:
137 + if chart == 'workers':
138 + lines = self.definitions[chart]['lines']
139 + lines[0] = ['idle_servers', 'idle']
140 + lines[1] = ['busy_servers', 'busy']
141 + opts = self.definitions[chart]['options']
142 + opts[1] = opts[1].replace('apache', 'lighttpd')
143 + opts[4] = opts[4].replace('apache', 'lighttpd')
144 +
145 +
146 +def parse_line(line, data):
147 + parts = line.split(':')
148 +
149 + if len(parts) != 2:
150 + return
151 +
152 + key, value = parts[0], parts[1]
153 +
154 + if key not in ASSIGNMENT:
155 + return
156 +
157 + if key in FLOAT_VALUES:
158 + data[ASSIGNMENT[key]] = int((float(value) * 100000))
159 + else:
160 + data[ASSIGNMENT[key]] = int(value)
collectors/python.d.plugin/beanstalk/beanstalk.chart.py
+11 -5
@@ -12,12 +12,18 @@ except ImportError:
12 from bases.FrameworkServices.SimpleService import SimpleService
13 from bases.loaders import safe_load
14
15 -# default module values (can be overridden per job in `config`)
16 -# update_every = 2
17 -priority = 60000
15
19 -ORDER = ['cpu_usage', 'jobs_rate', 'connections_rate', 'commands_rate', 'current_tubes', 'current_jobs',
20 - 'current_connections', 'binlog', 'uptime']
16 +ORDER = [
17 + 'cpu_usage',
18 + 'jobs_rate',
19 + 'connections_rate',
20 + 'commands_rate',
21 + 'current_tubes',
22 + 'current_jobs',
23 + 'current_connections',
24 + 'binlog',
25 + 'uptime',
26 +]
27
28 CHARTS = {
29 'cpu_usage': {
collectors/python.d.plugin/bind_rndc/bind_rndc.chart.py
+22 -7
@@ -11,10 +11,15 @@ from subprocess import Popen
11 from bases.collection import find_binary
12 from bases.FrameworkServices.SimpleService import SimpleService
13
14 -priority = 60000
14 +
15 update_every = 30
16
17 -ORDER = ['name_server_statistics', 'incoming_queries', 'outgoing_queries', 'named_stats_size']
17 +ORDER = [
18 + 'name_server_statistics',
19 + 'incoming_queries',
20 + 'outgoing_queries',
21 + 'named_stats_size',
22 +]
23
24 CHARTS = {
25 'name_server_statistics': {
@@ -43,7 +48,7 @@ CHARTS = {
48 'lines': [
49 ]},
50 'named_stats_size': {
46 - 'options': [None, 'Named Stats File Size', 'MB', 'file size', 'bind_rndc.stats_size', 'line'],
51 + 'options': [None, 'Named Stats File Size', 'MiB', 'file size', 'bind_rndc.stats_size', 'line'],
52 'lines': [
53 ['stats_size', None, 'absolute', 1, 1 << 20]
54 ]
@@ -91,10 +96,20 @@ class Service(SimpleService):
96 self.definitions = CHARTS
97 self.named_stats_path = self.configuration.get('named_stats_path', '/var/log/bind/named.stats')
98 self.rndc = find_binary('rndc')
94 - self.data = dict(nms_requests=0, nms_responses=0, nms_failure=0, nms_auth=0,
95 - nms_non_auth=0, nms_nxrrset=0, nms_success=0, nms_nxdomain=0,
96 - nms_recursion=0, nms_duplicate=0, nms_rejected_queries=0,
97 - nms_dropped_queries=0)
99 + self.data = dict(
100 + nms_requests=0,
101 + nms_responses=0,
102 + nms_failure=0,
103 + nms_auth=0,
104 + nms_non_auth=0,
105 + nms_nxrrset=0,
106 + nms_success=0,
107 + nms_nxdomain=0,
108 + nms_recursion=0,
109 + nms_duplicate=0,
110 + nms_rejected_queries=0,
111 + nms_dropped_queries=0,
112 + )
113
114 def check(self):
115 if not self.rndc:
collectors/python.d.plugin/boinc/boinc.chart.py
+11 -3
@@ -10,7 +10,12 @@ from bases.FrameworkServices.SimpleService import SimpleService
10 from third_party import boinc_client
11
12
13 -ORDER = ['tasks', 'states', 'sched_states', 'process_states']
13 +ORDER = [
14 + 'tasks',
15 + 'states',
16 + 'sched_states',
17 + 'process_states',
18 +]
19
20 CHARTS = {
21 'tasks': {
@@ -141,14 +146,16 @@ class Service(SimpleService):
146 def _get_data(self):
147 if not self.is_alive():
148 return None
149 +
150 data = dict(_DATA_TEMPLATE)
145 - results = []
151 +
152 try:
153 results = self.client.get_tasks()
154 except socket.error:
155 self.error('Connection is dead')
156 self.alive = False
157 return None
158 +
159 for task in results:
160 data['total'] += 1
161 data[_TASK_MAP[task.state]] += 1
@@ -159,4 +166,5 @@ class Service(SimpleService):
166 data[_PROC_MAP[task.active_task_state]] += 1
167 except AttributeError:
168 pass
162 - return data
169 +
170 + return data or None
collectors/python.d.plugin/ceph/ceph.chart.py
+8 -8
@@ -9,13 +9,13 @@ try:
9 except ImportError:
10 CEPH = False
11
12 -import os
12 import json
13 +import os
14 +
15 from bases.FrameworkServices.SimpleService import SimpleService
16
17 # default module values (can be overridden per job in `config`)
18 update_every = 10
18 -priority = 60000
19
20 ORDER = [
21 'general_usage',
@@ -36,7 +36,7 @@ ORDER = [
36
37 CHARTS = {
38 'general_usage': {
39 - 'options': [None, 'Ceph General Space', 'KB', 'general', 'ceph.general_usage', 'stacked'],
39 + 'options': [None, 'Ceph General Space', 'KiB', 'general', 'ceph.general_usage', 'stacked'],
40 'lines': [
41 ['general_available', 'avail', 'absolute'],
42 ['general_usage', 'used', 'absolute']
@@ -49,7 +49,7 @@ CHARTS = {
49 ]
50 },
51 'general_bytes': {
52 - 'options': [None, 'Ceph General Read/Write Data/s', 'KB', 'general', 'ceph.general_bytes',
52 + 'options': [None, 'Ceph General Read/Write Data/s', 'KiB/s', 'general', 'ceph.general_bytes',
53 'area'],
54 'lines': [
55 ['general_read_bytes', 'read', 'absolute', 1, 1024],
@@ -73,7 +73,7 @@ CHARTS = {
73 ]
74 },
75 'pool_usage': {
76 - 'options': [None, 'Ceph Pools', 'KB', 'pool', 'ceph.pool_usage', 'line'],
76 + 'options': [None, 'Ceph Pools', 'KiB', 'pool', 'ceph.pool_usage', 'line'],
77 'lines': []
78 },
79 'pool_objects': {
@@ -81,11 +81,11 @@ CHARTS = {
81 'lines': []
82 },
83 'pool_read_bytes': {
84 - 'options': [None, 'Ceph Read Pool Data/s', 'KB', 'pool', 'ceph.pool_read_bytes', 'area'],
84 + 'options': [None, 'Ceph Read Pool Data/s', 'KiB/s', 'pool', 'ceph.pool_read_bytes', 'area'],
85 'lines': []
86 },
87 'pool_write_bytes': {
88 - 'options': [None, 'Ceph Write Pool Data/s', 'KB', 'pool', 'ceph.pool_write_bytes', 'area'],
88 + 'options': [None, 'Ceph Write Pool Data/s', 'KiB/s', 'pool', 'ceph.pool_write_bytes', 'area'],
89 'lines': []
90 },
91 'pool_read_operations': {
@@ -97,7 +97,7 @@ CHARTS = {
97 'lines': []
98 },
99 'osd_usage': {
100 - 'options': [None, 'Ceph OSDs', 'KB', 'osd', 'ceph.osd_usage', 'line'],
100 + 'options': [None, 'Ceph OSDs', 'KiB', 'osd', 'ceph.osd_usage', 'line'],
101 'lines': []
102 },
103 'osd_apply_latency': {
collectors/python.d.plugin/chrony/chrony.chart.py
+12 -3
@@ -7,10 +7,19 @@ from bases.FrameworkServices.ExecutableService import ExecutableService
7
8 # default module values (can be overridden per job in `config`)
9 update_every = 5
10 -priority = 60000
10 +
11 +CHRONY_COMMAND = 'chronyc -n tracking'
12
13 # charts order (can be overridden if you want less charts, or different order)
13 -ORDER = ['system', 'offsets', 'stratum', 'root', 'frequency', 'residualfreq', 'skew']
14 +ORDER = [
15 + 'system',
16 + 'offsets',
17 + 'stratum',
18 + 'root',
19 + 'frequency',
20 + 'residualfreq',
21 + 'skew',
22 +]
23
24 CHARTS = {
25 'system': {
@@ -76,9 +85,9 @@ class Service(ExecutableService):
85 def __init__(self, configuration=None, name=None):
86 ExecutableService.__init__(
87 self, configuration=configuration, name=name)
79 - self.command = 'chronyc -n tracking'
88 self.order = ORDER
89 self.definitions = CHARTS
90 + self.command = CHRONY_COMMAND
91
92 def _get_data(self):
93 """
collectors/python.d.plugin/couchdb/couchdb.chart.py
+18 -28
@@ -8,6 +8,7 @@ from collections import namedtuple, defaultdict
8 from json import loads
9 from threading import Thread
10 from socket import gethostbyname, gaierror
11 +
12 try:
13 from queue import Queue
14 except ImportError:
@@ -15,9 +16,9 @@ except ImportError:
16
17 from bases.FrameworkServices.UrlService import UrlService
18
18 -# default module values (can be overridden per job in `config`)
19 +
20 update_every = 1
20 -priority = 60000
21 +
22
23 METHODS = namedtuple('METHODS', ['get_data', 'url', 'stats'])
24
@@ -108,7 +109,7 @@ ORDER = [
109
110 CHARTS = {
111 'activity': {
111 - 'options': [None, 'Overall Activity', 'req/s',
112 + 'options': [None, 'Overall Activity', 'requests/s',
113 'dbactivity', 'couchdb.activity', 'stacked'],
114 'lines': [
115 ['couchdb_database_reads', 'DB reads', 'incremental'],
@@ -117,7 +118,7 @@ CHARTS = {
118 ]
119 },
120 'request_methods': {
120 - 'options': [None, 'HTTP request methods', 'req/s',
121 + 'options': [None, 'HTTP request methods', 'requests/s',
122 'httptraffic', 'couchdb.request_methods',
123 'stacked'],
124 'lines': [
@@ -132,7 +133,7 @@ CHARTS = {
133 ]
134 },
135 'response_codes': {
135 - 'options': [None, 'HTTP response status codes', 'resp/s',
136 + 'options': [None, 'HTTP response status codes', 'responses/s',
137 'httptraffic', 'couchdb.response_codes',
138 'stacked'],
139 'lines': [
@@ -150,15 +151,13 @@ CHARTS = {
151 ]
152 },
153 'open_files': {
153 - 'options': [None, 'Open files', 'files',
154 - 'ops', 'couchdb.open_files', 'line'],
154 + 'options': [None, 'Open files', 'files', 'ops', 'couchdb.open_files', 'line'],
155 'lines': [
156 ['couchdb_open_os_files', '# files', 'absolute']
157 ]
158 },
159 'active_tasks': {
160 - 'options': [None, 'Active task breakdown', 'tasks',
161 - 'ops', 'couchdb.active_tasks', 'stacked'],
160 + 'options': [None, 'Active task breakdown', 'tasks', 'ops', 'couchdb.active_tasks', 'stacked'],
161 'lines': [
162 ['activetasks_indexer', 'Indexer', 'absolute'],
163 ['activetasks_database_compaction', 'DB Compaction', 'absolute'],
@@ -167,8 +166,7 @@ CHARTS = {
166 ]
167 },
168 'replicator_jobs': {
170 - 'options': [None, 'Replicator job breakdown', 'jobs',
171 - 'ops', 'couchdb.replicator_jobs', 'stacked'],
169 + 'options': [None, 'Replicator job breakdown', 'jobs', 'ops', 'couchdb.replicator_jobs', 'stacked'],
170 'lines': [
171 ['couch_replicator_jobs_running', 'Running', 'absolute'],
172 ['couch_replicator_jobs_pending', 'Pending', 'absolute'],
@@ -178,8 +176,7 @@ CHARTS = {
176 ]
177 },
178 'erlang_memory': {
181 - 'options': [None, 'Erlang VM memory usage', 'bytes',
182 - 'erlang', 'couchdb.erlang_vm_memory', 'stacked'],
179 + 'options': [None, 'Erlang VM memory usage', 'B', 'erlang', 'couchdb.erlang_vm_memory', 'stacked'],
180 'lines': [
181 ['memory_atom', 'atom', 'absolute'],
182 ['memory_binary', 'binaries', 'absolute'],
@@ -190,23 +187,20 @@ CHARTS = {
187 ]
188 },
189 'erlang_reductions': {
193 - 'options': [None, 'Erlang reductions', 'count',
194 - 'erlang', 'couchdb.reductions', 'line'],
190 + 'options': [None, 'Erlang reductions', 'count', 'erlang', 'couchdb.reductions', 'line'],
191 'lines': [
192 ['reductions', 'reductions', 'incremental']
193 ]
194 },
195 'erlang_proc_counts': {
200 - 'options': [None, 'Process counts', 'count',
201 - 'erlang', 'couchdb.proccounts', 'line'],
196 + 'options': [None, 'Process counts', 'count', 'erlang', 'couchdb.proccounts', 'line'],
197 'lines': [
198 ['os_proc_count', 'OS procs', 'absolute'],
199 ['process_count', 'erl procs', 'absolute']
200 ]
201 },
202 'erlang_peak_msg_queue': {
208 - 'options': [None, 'Peak message queue size', 'count',
209 - 'erlang', 'couchdb.peakmsgqueue',
203 + 'options': [None, 'Peak message queue size', 'count', 'erlang', 'couchdb.peakmsgqueue',
204 'line'],
205 'lines': [
206 ['peak_msg_queue', 'peak size', 'absolute']
@@ -214,18 +208,15 @@ CHARTS = {
208 },
209 # Lines for the following are added as part of check()
210 'db_sizes_file': {
217 - 'options': [None, 'Database sizes (file)', 'KB',
218 - 'perdbstats', 'couchdb.db_sizes_file', 'line'],
211 + 'options': [None, 'Database sizes (file)', 'KiB', 'perdbstats', 'couchdb.db_sizes_file', 'line'],
212 'lines': []
213 },
214 'db_sizes_external': {
222 - 'options': [None, 'Database sizes (external)', 'KB',
223 - 'perdbstats', 'couchdb.db_sizes_external', 'line'],
215 + 'options': [None, 'Database sizes (external)', 'KiB', 'perdbstats', 'couchdb.db_sizes_external', 'line'],
216 'lines': []
217 },
218 'db_sizes_active': {
227 - 'options': [None, 'Database sizes (active)', 'KB',
228 - 'perdbstats', 'couchdb.db_sizes_active', 'line'],
219 + 'options': [None, 'Database sizes (active)', 'KiB', 'perdbstats', 'couchdb.db_sizes_active', 'line'],
220 'lines': []
221 },
222 'db_doc_counts': {
@@ -234,8 +225,7 @@ CHARTS = {
225 'lines': []
226 },
227 'db_doc_del_counts': {
237 - 'options': [None, 'Database # of deleted docs', 'docs',
238 - 'perdbstats', 'couchdb_db_doc_del_count', 'line'],
228 + 'options': [None, 'Database # of deleted docs', 'docs', 'perdbstats', 'couchdb_db_doc_del_count', 'line'],
229 'lines': []
230 }
231 }
@@ -255,7 +245,7 @@ class Service(UrlService):
245 try:
246 self.dbs = self.configuration.get('databases').split(' ')
247 except (KeyError, AttributeError):
258 - self.dbs = []
248 + self.dbs = list()
249
250 def check(self):
251 if not (self.host and self.port):
collectors/python.d.plugin/dns_query_time/dns_query_time.chart.py
+14 -7
@@ -28,10 +28,7 @@ except ImportError:
28 from bases.FrameworkServices.SimpleService import SimpleService
29
30
31 -# default module values (can be overridden per job in `config`)
31 update_every = 5
33 -priority = 60000
34 -retries = 60
32
33
34 class Service(SimpleService):
@@ -46,14 +43,14 @@ class Service(SimpleService):
43
44 def check(self):
45 if not DNS_PYTHON:
49 - self.error('\'python-dnspython\' package is needed to use dns_query_time.chart.py')
46 + self.error("'python-dnspython' package is needed to use dns_query_time.chart.py")
47 return False
48
49 self.timeout = self.timeout if isinstance(self.timeout, int) else 4
50
51 if not all([self.domains, self.server_list,
52 isinstance(self.server_list, str), isinstance(self.domains, str)]):
56 - self.error('server_list and domain_list can\'t be empty')
53 + self.error("server_list and domain_list can't be empty")
54 return False
55 else:
56 self.domains, self.server_list = self.domains.split(), self.server_list.split()
@@ -129,17 +126,27 @@ def create_charts(aggregate, server_list):
126 }
127 }
128 for ns in server_list:
132 - definitions['dns_group']['lines'].append(['_'.join(['ns', ns.replace('.', '_')]), ns, 'absolute'])
129 + dim = [
130 + '_'.join(['ns', ns.replace('.', '_')]),
131 + ns,
132 + 'absolute',
133 + ]
134 + definitions['dns_group']['lines'].append(dim)
135
136 return order, definitions
137 else:
138 order = [''.join(['dns_', ns.replace('.', '_')]) for ns in server_list]
139 definitions = dict()
140 +
141 for ns in server_list:
142 definitions[''.join(['dns_', ns.replace('.', '_')])] = {
143 'options': [None, 'DNS Response Time', 'ms', ns, 'dns_query_time.response_time', 'area'],
144 'lines': [
142 - ['_'.join(['ns', ns.replace('.', '_')]), ns, 'absolute']
145 + [
146 + '_'.join(['ns', ns.replace('.', '_')]),
147 + ns,
148 + 'absolute',
149 + ]
150 ]
151 }
152 return order, definitions
collectors/python.d.plugin/dnsdist/dnsdist.chart.py
+2 -2
@@ -90,9 +90,9 @@ CHARTS = {
90 ]
91 },
92 'servermem': {
93 - 'options': [None, 'DNSDIST server memory utilization', 'MB', 'server', 'dnsdist.servermem', 'area'],
93 + 'options': [None, 'DNSDIST server memory utilization', 'MiB', 'server', 'dnsdist.servermem', 'area'],
94 'lines': [
95 - ['real-memory-usage', 'memory usage', 'absolute', 1, 1048576]
95 + ['real-memory-usage', 'memory usage', 'absolute', 1, 1 << 20]
96 ]
97 },
98 'query_latency': {
collectors/python.d.plugin/dockerd/dockerd.chart.py
+6 -4
@@ -23,21 +23,21 @@ ORDER = [
23
24 CHARTS = {
25 'running_containers': {
26 - 'options': [None, 'Number of running containers', 'running containers', 'running containers',
26 + 'options': [None, 'Number of running containers', 'containers', 'running containers',
27 'docker.running_containers', 'line'],
28 'lines': [
29 ['running_containers', 'running']
30 ]
31 },
32 'healthy_containers': {
33 - 'options': [None, 'Number of healthy containers', 'healthy containers', 'healthy containers',
33 + 'options': [None, 'Number of healthy containers', 'containers', 'healthy containers',
34 'docker.healthy_containers', 'line'],
35 'lines': [
36 ['healthy_containers', 'healthy']
37 ]
38 },
39 'unhealthy_containers': {
40 - 'options': [None, 'Number of unhealthy containers', 'unhealthy containers', 'unhealthy containers',
40 + 'options': [None, 'Number of unhealthy containers', 'containers', 'unhealthy containers',
41 'docker.unhealthy_containers', 'line'],
42 'lines': [
43 ['unhealthy_containers', 'unhealthy']
@@ -51,10 +51,11 @@ class Service(SimpleService):
51 SimpleService.__init__(self, configuration=configuration, name=name)
52 self.order = ORDER
53 self.definitions = CHARTS
54 + self.client = None
55
56 def check(self):
57 if not HAS_DOCKER:
57 - self.error('\'docker\' package is needed to use docker.chart.py')
58 + self.error("'docker' package is needed to use docker.chart.py")
59 return False
60
61 self.client = docker.DockerClient(base_url=self.configuration.get('url', 'unix://var/run/docker.sock'))
@@ -69,6 +70,7 @@ class Service(SimpleService):
70
71 def get_data(self):
72 data = dict()
73 +
74 data['running_containers'] = len(self.client.containers.list(sparse=True))
75 data['healthy_containers'] = len(self.client.containers.list(filters={'health': 'healthy'}, sparse=True))
76 data['unhealthy_containers'] = len(self.client.containers.list(filters={'health': 'unhealthy'}, sparse=True))
collectors/python.d.plugin/dovecot/dovecot.chart.py
+11 -13
@@ -5,11 +5,10 @@
5
6 from bases.FrameworkServices.SocketService import SocketService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 2
10 -priority = 60000
8
12 -# charts order (can be overridden if you want less charts, or different order)
9 +UNIX_SOCKET = '/var/run/dovecot/stats'
10 +
11 +
12 ORDER = [
13 'sessions',
14 'logins',
@@ -52,14 +51,14 @@ CHARTS = {
51 ]
52 },
53 'context_switches': {
55 - 'options': [None, 'Dovecot Context Switches', '', 'context switches', 'dovecot.context_switches', 'line'],
54 + 'options': [None, 'Dovecot Context Switches', 'switches', 'context switches', 'dovecot.context_switches', 'line'],
55 'lines': [
56 ['vol_cs', 'voluntary', 'absolute'],
57 ['invol_cs', 'involuntary', 'absolute']
58 ]
59 },
60 'io': {
62 - 'options': [None, 'Dovecot Disk I/O', 'kilobytes/s', 'disk', 'dovecot.io', 'area'],
61 + 'options': [None, 'Dovecot Disk I/O', 'KiB/s', 'disk', 'dovecot.io', 'area'],
62 'lines': [
63 ['disk_input', 'read', 'incremental', 1, 1024],
64 ['disk_output', 'write', 'incremental', -1, 1024]
@@ -68,8 +67,8 @@ CHARTS = {
67 'net': {
68 'options': [None, 'Dovecot Network Bandwidth', 'kilobits/s', 'network', 'dovecot.net', 'area'],
69 'lines': [
71 - ['read_bytes', 'read', 'incremental', 8, 1024],
72 - ['write_bytes', 'write', 'incremental', -8, 1024]
70 + ['read_bytes', 'read', 'incremental', 8, 1000],
71 + ['write_bytes', 'write', 'incremental', -8, 1000]
72 ]
73 },
74 'syscalls': {
@@ -112,13 +111,12 @@ CHARTS = {
111 class Service(SocketService):
112 def __init__(self, configuration=None, name=None):
113 SocketService.__init__(self, configuration=configuration, name=name)
115 - self.request = 'EXPORT\tglobal\r\n'
116 - self.host = None # localhost
117 - self.port = None # 24242
118 - # self._keep_alive = True
119 - self.unix_socket = '/var/run/dovecot/stats'
114 self.order = ORDER
115 self.definitions = CHARTS
116 + self.host = None # localhost
117 + self.port = None # 24242
118 + self.unix_socket = UNIX_SOCKET
119 + self.request = 'EXPORT\tglobal\r\n'
120
121 def _get_data(self):
122 """
collectors/python.d.plugin/elasticsearch/elasticsearch.chart.py
+53 -30
@@ -159,17 +159,20 @@ ORDER = [
159 'fielddata_evictions_tripped',
160 'cluster_health_status',
161 'cluster_health_nodes',
162 + 'cluster_health_pending_tasks',
163 + 'cluster_health_flight_fetch',
164 'cluster_health_shards',
165 'cluster_stats_nodes',
166 'cluster_stats_query_cache',
167 'cluster_stats_docs',
168 'cluster_stats_store',
167 - 'cluster_stats_indices_shards',
169 + 'cluster_stats_indices',
170 + 'cluster_stats_shards_total',
171 ]
172
173 CHARTS = {
174 'search_performance_total': {
172 - 'options': [None, 'Queries And Fetches', 'number of', 'search performance',
175 + 'options': [None, 'Queries And Fetches', 'events/s', 'search performance',
176 'elastic.search_performance_total', 'stacked'],
177 'lines': [
178 ['indices_search_query_total', 'queries', 'incremental'],
@@ -177,7 +180,7 @@ CHARTS = {
180 ]
181 },
182 'search_performance_current': {
180 - 'options': [None, 'Queries and Fetches In Progress', 'number of', 'search performance',
183 + 'options': [None, 'Queries and Fetches In Progress', 'events', 'search performance',
184 'elastic.search_performance_current', 'stacked'],
185 'lines': [
186 ['indices_search_query_current', 'queries', 'absolute'],
@@ -193,14 +196,14 @@ CHARTS = {
196 ]
197 },
198 'search_latency': {
196 - 'options': [None, 'Query And Fetch Latency', 'ms', 'search performance', 'elastic.search_latency', 'stacked'],
199 + 'options': [None, 'Query And Fetch Latency', 'milliseconds', 'search performance', 'elastic.search_latency', 'stacked'],
200 'lines': [
201 ['query_latency', 'query', 'absolute', 1, 1000],
202 ['fetch_latency', 'fetch', 'absolute', 1, 1000]
203 ]
204 },
205 'index_performance_total': {
203 - 'options': [None, 'Indexed Documents, Index Refreshes, Index Flushes To Disk', 'number of',
206 + 'options': [None, 'Indexed Documents, Index Refreshes, Index Flushes To Disk', 'events/s',
207 'indexing performance', 'elastic.index_performance_total', 'stacked'],
208 'lines': [
209 ['indices_indexing_index_total', 'indexed', 'incremental'],
@@ -225,7 +228,7 @@ CHARTS = {
228 ]
229 },
230 'index_latency': {
228 - 'options': [None, 'Indexing And Flushing Latency', 'ms', 'indexing performance',
231 + 'options': [None, 'Indexing And Flushing Latency', 'milliseconds', 'indexing performance',
232 'elastic.index_latency', 'stacked'],
233 'lines': [
234 ['indexing_latency', 'indexing', 'absolute', 1, 1000],
@@ -233,7 +236,7 @@ CHARTS = {
236 ]
237 },
238 'index_translog_operations': {
236 - 'options': [None, 'Translog Operations', 'count', 'translog',
239 + 'options': [None, 'Translog Operations', 'operations', 'translog',
240 'elastic.index_translog_operations', 'area'],
241 'lines': [
242 ['indices_translog_operations', 'total', 'absolute'],
@@ -241,7 +244,7 @@ CHARTS = {
244 ]
245 },
246 'index_translog_size': {
244 - 'options': [None, 'Translog Size', 'MB', 'translog',
247 + 'options': [None, 'Translog Size', 'MiB', 'translog',
248 'elastic.index_translog_size', 'area'],
249 'lines': [
250 ['indices_translog_size_in_bytes', 'total', 'absolute', 1, 1048567],
@@ -249,21 +252,21 @@ CHARTS = {
252 ]
253 },
254 'index_segments_count': {
252 - 'options': [None, 'Total Number Of Indices Segments', 'count', 'indices segments',
255 + 'options': [None, 'Total Number Of Indices Segments', 'segments', 'indices segments',
256 'elastic.index_segments_count', 'line'],
257 'lines': [
258 ['indices_segments_count', 'segments', 'absolute']
259 ]
260 },
261 'index_segments_memory_writer': {
259 - 'options': [None, 'Index Writer Memory Usage', 'MB', 'indices segments',
262 + 'options': [None, 'Index Writer Memory Usage', 'MiB', 'indices segments',
263 'elastic.index_segments_memory_writer', 'area'],
264 'lines': [
265 ['indices_segments_index_writer_memory_in_bytes', 'total', 'absolute', 1, 1048567]
266 ]
267 },
268 'index_segments_memory': {
266 - 'options': [None, 'Indices Segments Memory Usage', 'MB', 'indices segments',
269 + 'options': [None, 'Indices Segments Memory Usage', 'MiB', 'indices segments',
270 'elastic.index_segments_memory', 'stacked'],
271 'lines': [
272 ['indices_segments_terms_memory_in_bytes', 'terms', 'absolute', 1, 1048567],
@@ -277,14 +280,14 @@ CHARTS = {
280 ]
281 },
282 'jvm_mem_heap': {
280 - 'options': [None, 'JVM Heap Percentage Currently in Use', 'percent', 'memory usage and gc',
283 + 'options': [None, 'JVM Heap Percentage Currently in Use', 'percentage', 'memory usage and gc',
284 'elastic.jvm_heap', 'area'],
285 'lines': [
286 ['jvm_mem_heap_used_percent', 'inuse', 'absolute']
287 ]
288 },
289 'jvm_mem_heap_bytes': {
287 - 'options': [None, 'JVM Heap Commit And Usage', 'MB', 'memory usage and gc',
290 + 'options': [None, 'JVM Heap Commit And Usage', 'MiB', 'memory usage and gc',
291 'elastic.jvm_heap_bytes', 'area'],
292 'lines': [
293 ['jvm_mem_heap_committed_in_bytes', 'commited', 'absolute', 1, 1048576],
@@ -292,7 +295,7 @@ CHARTS = {
295 ]
296 },
297 'jvm_buffer_pool_count': {
295 - 'options': [None, 'JVM Buffers', 'count', 'memory usage and gc',
298 + 'options': [None, 'JVM Buffers', 'pools', 'memory usage and gc',
299 'elastic.jvm_buffer_pool_count', 'line'],
300 'lines': [
301 ['jvm_buffer_pools_direct_count', 'direct', 'absolute'],
@@ -300,7 +303,7 @@ CHARTS = {
303 ]
304 },
305 'jvm_direct_buffers_memory': {
303 - 'options': [None, 'JVM Direct Buffers Memory', 'MB', 'memory usage and gc',
306 + 'options': [None, 'JVM Direct Buffers Memory', 'MiB', 'memory usage and gc',
307 'elastic.jvm_direct_buffers_memory', 'area'],
308 'lines': [
309 ['jvm_buffer_pools_direct_used_in_bytes', 'used', 'absolute', 1, 1048567],
@@ -308,7 +311,7 @@ CHARTS = {
311 ]
312 },
313 'jvm_mapped_buffers_memory': {
311 - 'options': [None, 'JVM Mapped Buffers Memory', 'MB', 'memory usage and gc',
314 + 'options': [None, 'JVM Mapped Buffers Memory', 'MiB', 'memory usage and gc',
315 'elastic.jvm_mapped_buffers_memory', 'area'],
316 'lines': [
317 ['jvm_buffer_pools_mapped_used_in_bytes', 'used', 'absolute', 1, 1048567],
@@ -316,14 +319,14 @@ CHARTS = {
319 ]
320 },
321 'jvm_gc_count': {
319 - 'options': [None, 'Garbage Collections', 'counts', 'memory usage and gc', 'elastic.gc_count', 'stacked'],
322 + 'options': [None, 'Garbage Collections', 'events/s', 'memory usage and gc', 'elastic.gc_count', 'stacked'],
323 'lines': [
324 ['jvm_gc_collectors_young_collection_count', 'young', 'incremental'],
325 ['jvm_gc_collectors_old_collection_count', 'old', 'incremental']
326 ]
327 },
328 'jvm_gc_time': {
326 - 'options': [None, 'Time Spent On Garbage Collections', 'ms', 'memory usage and gc',
329 + 'options': [None, 'Time Spent On Garbage Collections', 'milliseconds', 'memory usage and gc',
330 'elastic.gc_time', 'stacked'],
331 'lines': [
332 ['jvm_gc_collectors_young_collection_time_in_millis', 'young', 'incremental'],
@@ -353,13 +356,13 @@ CHARTS = {
356 ]
357 },
358 'fielddata_cache': {
356 - 'options': [None, 'Fielddata Cache', 'MB', 'fielddata cache', 'elastic.fielddata_cache', 'line'],
359 + 'options': [None, 'Fielddata Cache', 'MiB', 'fielddata cache', 'elastic.fielddata_cache', 'line'],
360 'lines': [
361 ['indices_fielddata_memory_size_in_bytes', 'cache', 'absolute', 1, 1048576]
362 ]
363 },
364 'fielddata_evictions_tripped': {
362 - 'options': [None, 'Fielddata Evictions And Circuit Breaker Tripped Count', 'number of events',
365 + 'options': [None, 'Fielddata Evictions And Circuit Breaker Tripped Count', 'events/s',
366 'fielddata cache', 'elastic.fielddata_evictions_tripped', 'line'],
367 'lines': [
368 ['indices_fielddata_evictions', 'evictions', 'incremental'],
@@ -367,12 +370,24 @@ CHARTS = {
370 ]
371 },
372 'cluster_health_nodes': {
370 - 'options': [None, 'Nodes And Tasks Statistics', 'units', 'cluster health API',
373 + 'options': [None, 'Nodes Statistics', 'nodes', 'cluster health API',
374 'elastic.cluster_health_nodes', 'stacked'],
375 'lines': [
376 ['number_of_nodes', 'nodes', 'absolute'],
377 ['number_of_data_nodes', 'data_nodes', 'absolute'],
378 + ]
379 + },
380 + 'cluster_health_pending_tasks': {
381 + 'options': [None, 'Tasks Statistics', 'tasks', 'cluster health API',
382 + 'elastic.cluster_health_pending_tasks', 'line'],
383 + 'lines': [
384 ['number_of_pending_tasks', 'pending_tasks', 'absolute'],
385 + ]
386 + },
387 + 'cluster_health_flight_fetch': {
388 + 'options': [None, 'In Flight Fetches Statistics', 'fetches', 'cluster health API',
389 + 'elastic.cluster_health_flight_fetch', 'line'],
390 + 'lines': [
391 ['number_of_in_flight_fetch', 'in_flight_fetch', 'absolute']
392 ]
393 },
@@ -420,24 +435,30 @@ CHARTS = {
435 ]
436 },
437 'cluster_stats_docs': {
423 - 'options': [None, 'Docs Statistics', 'count', 'cluster stats API',
438 + 'options': [None, 'Docs Statistics', 'docs', 'cluster stats API',
439 'elastic.cluster_docs', 'line'],
440 'lines': [
441 ['indices_docs_count', 'docs', 'absolute']
442 ]
443 },
444 'cluster_stats_store': {
430 - 'options': [None, 'Store Statistics', 'MB', 'cluster stats API',
445 + 'options': [None, 'Store Statistics', 'MiB', 'cluster stats API',
446 'elastic.cluster_store', 'line'],
447 'lines': [
448 ['indices_store_size_in_bytes', 'size', 'absolute', 1, 1048567]
449 ]
450 },
436 - 'cluster_stats_indices_shards': {
437 - 'options': [None, 'Indices And Shards Statistics', 'count', 'cluster stats API',
438 - 'elastic.cluster_indices_shards', 'stacked'],
451 + 'cluster_stats_indices': {
452 + 'options': [None, 'Indices Statistics', 'indices', 'cluster stats API',
453 + 'elastic.cluster_indices', 'line'],
454 'lines': [
455 ['indices_count', 'indices', 'absolute'],
456 + ]
457 + },
458 + 'cluster_stats_shards_total': {
459 + 'options': [None, 'Total Shards Statistics', 'shards', 'cluster stats API',
460 + 'elastic.cluster_shards_total', 'line'],
461 + 'lines': [
462 ['indices_shards_total', 'shards', 'absolute']
463 ]
464 },
@@ -450,7 +471,7 @@ CHARTS = {
471 ]
472 },
473 'host_metrics_file_descriptors': {
453 - 'options': [None, 'Available File Descriptors In Percent', 'percent', 'host metrics',
474 + 'options': [None, 'Available File Descriptors In Percent', 'percentage', 'host metrics',
475 'elastic.host_descriptors', 'area'],
476 'lines': [
477 ['file_descriptors_used', 'used', 'absolute', 1, 10]
@@ -473,9 +494,11 @@ class Service(UrlService):
494 self.definitions = CHARTS
495 self.host = self.configuration.get('host')
496 self.port = self.configuration.get('port', 9200)
476 - self.url = '{scheme}://{host}:{port}'.format(scheme=self.configuration.get('scheme', 'http'),
477 - host=self.host,
478 - port=self.port)
497 + self.url = '{scheme}://{host}:{port}'.format(
498 + scheme=self.configuration.get('scheme', 'http'),
499 + host=self.host,
500 + port=self.port,
501 + )
502 self.latency = dict()
503 self.methods = list()
504
collectors/python.d.plugin/example/example.chart.py
+5 -3
@@ -7,11 +7,13 @@ from random import SystemRandom
7
8 from bases.FrameworkServices.SimpleService import SimpleService
9
10 -# default module values
11 -# update_every = 4
10 +
11 priority = 90000
12
14 -ORDER = ['random']
13 +ORDER = [
14 + 'random',
15 +]
16 +
17 CHARTS = {
18 'random': {
19 'options': [None, 'A random number', 'random number', 'random', 'random', 'line'],
collectors/python.d.plugin/exim/exim.chart.py
+6 -6
@@ -5,12 +5,12 @@
5
6 from bases.FrameworkServices.ExecutableService import ExecutableService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 2
10 -priority = 60000
8
12 -# charts order (can be overridden if you want less charts, or different order)
13 -ORDER = ['qemails']
9 +EXIM_COMMAND = 'exim -bpc'
10 +
11 +ORDER = [
12 + 'qemails',
13 +]
14
15 CHARTS = {
16 'qemails': {
@@ -25,9 +25,9 @@ CHARTS = {
25 class Service(ExecutableService):
26 def __init__(self, configuration=None, name=None):
27 ExecutableService.__init__(self, configuration=configuration, name=name)
28 - self.command = 'exim -bpc'
28 self.order = ORDER
29 self.definitions = CHARTS
30 + self.command = EXIM_COMMAND
31
32 def _get_data(self):
33 """
collectors/python.d.plugin/fail2ban/fail2ban.chart.py
+13 -4
@@ -35,8 +35,19 @@ def charts(jails):
35 },
36 }
37 for jail in jails:
38 - ch[ORDER[0]]['lines'].append([jail, jail, 'incremental'])
39 - ch[ORDER[1]]['lines'].append(['{0}_in_jail'.format(jail), jail, 'absolute'])
38 + dim = [
39 + jail,
40 + jail,
41 + 'incremental',
42 + ]
43 + ch[ORDER[0]]['lines'].append(dim)
44 +
45 + dim = [
46 + '{0}_in_jail'.format(jail),
47 + jail,
48 + 'absolute',
49 + ]
50 + ch[ORDER[1]]['lines'].append(dim)
51
52 return ch
53
@@ -59,12 +70,10 @@ class Service(LogService):
70 LogService.__init__(self, configuration=configuration, name=name)
71 self.order = ORDER
72 self.definitions = dict()
62 -
73 self.log_path = self.configuration.get('log_path', '/var/log/fail2ban.log')
74 self.conf_path = self.configuration.get('conf_path', '/etc/fail2ban/jail.local')
75 self.conf_dir = self.configuration.get('conf_dir', '/etc/fail2ban/jail.d/')
76 self.exclude = self.configuration.get('exclude', str())
67 -
77 self.monitoring_jails = list()
78 self.banned_ips = defaultdict(set)
79 self.data = dict()
collectors/python.d.plugin/freeradius/freeradius.chart.py
+78 -29
@@ -3,24 +3,37 @@
3 # Author: l2isbad
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 -from re import findall
6 +import re
7 from subprocess import Popen, PIPE
8
9 from bases.collection import find_binary
10 from bases.FrameworkServices.SimpleService import SimpleService
11
12 -# default module values (can be overridden per job in `config`)
13 -priority = 60000
12 update_every = 15
13
14 +PARSER = re.compile(r'((?<=-)[AP][a-zA-Z-]+) = (\d+)')
15 +
16 RADIUS_MSG = 'Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 15, Response-Packet-Type = Access-Accept'
17
18 -# charts order (can be overridden if you want less charts, or different order)
19 -ORDER = ['authentication', 'accounting', 'proxy-auth', 'proxy-acct']
18 +RADCLIENT_RETRIES = 1
19 +RADCLIENT_TIMEOUT = 1
20 +
21 +DEFAULT_HOST = 'localhost'
22 +DEFAULT_PORT = 18121
23 +DEFAULT_DO_ACCT = False
24 +DEFAULT_DO_PROXY_AUTH = False
25 +DEFAULT_DO_PROXY_ACCT = False
26 +
27 +ORDER = [
28 + 'authentication',
29 + 'accounting',
30 + 'proxy-auth',
31 + 'proxy-acct',
32 +]
33
34 CHARTS = {
35 'authentication': {
23 - 'options': [None, 'Authentication', 'packets/s', 'Authentication', 'freerad.auth', 'line'],
36 + 'options': [None, 'Authentication', 'packets/s', 'authentication', 'freerad.auth', 'line'],
37 'lines': [
38 ['access-accepts', None, 'incremental'],
39 ['access-rejects', None, 'incremental'],
@@ -32,7 +45,7 @@ CHARTS = {
45 ]
46 },
47 'accounting': {
35 - 'options': [None, 'Accounting', 'packets/s', 'Accounting', 'freerad.acct', 'line'],
48 + 'options': [None, 'Accounting', 'packets/s', 'accounting', 'freerad.acct', 'line'],
49 'lines': [
50 ['accounting-requests', 'requests', 'incremental'],
51 ['accounting-responses', 'responses', 'incremental'],
@@ -44,7 +57,7 @@ CHARTS = {
57 ]
58 },
59 'proxy-auth': {
47 - 'options': [None, 'Proxy Authentication', 'packets/s', 'Authentication', 'freerad.proxy.auth', 'line'],
60 + 'options': [None, 'Proxy Authentication', 'packets/s', 'authentication', 'freerad.proxy.auth', 'line'],
61 'lines': [
62 ['proxy-access-accepts', 'access-accepts', 'incremental'],
63 ['proxy-access-rejects', 'access-rejects', 'incremental'],
@@ -56,7 +69,7 @@ CHARTS = {
69 ]
70 },
71 'proxy-acct': {
59 - 'options': [None, 'Proxy Accounting', 'packets/s', 'Accounting', 'freerad.proxy.acct', 'line'],
72 + 'options': [None, 'Proxy Accounting', 'packets/s', 'accounting', 'freerad.proxy.acct', 'line'],
73 'lines': [
74 ['proxy-accounting-requests', 'requests', 'incremental'],
75 ['proxy-accounting-responses', 'responses', 'incremental'],
@@ -70,46 +83,80 @@ CHARTS = {
83 }
84
85
86 +def radclient_status(radclient, retries, timeout, host, port, secret):
87 + # radclient -r 1 -t 1 -x 127.0.0.1:18121 status secret
88 +
89 + return '{radclient} -r {num_retries} -t {timeout} -x {host}:{port} status {secret}'.format(
90 + radclient=radclient,
91 + num_retries=retries,
92 + timeout=timeout,
93 + host=host,
94 + port=port,
95 + secret=secret,
96 + ).split()
97 +
98 +
99 class Service(SimpleService):
100 def __init__(self, configuration=None, name=None):
101 SimpleService.__init__(self, configuration=configuration, name=name)
102 + self.order = ORDER
103 self.definitions = CHARTS
77 - self.host = self.configuration.get('host', 'localhost')
78 - self.port = self.configuration.get('port', '18121')
104 + self.host = self.configuration.get('host', DEFAULT_HOST)
105 + self.port = self.configuration.get('port', DEFAULT_PORT)
106 self.secret = self.configuration.get('secret')
80 - self.acct = self.configuration.get('acct', False)
81 - self.proxy_auth = self.configuration.get('proxy_auth', False)
82 - self.proxy_acct = self.configuration.get('proxy_acct', False)
83 - chart_choice = [True, bool(self.acct), bool(self.proxy_auth), bool(self.proxy_acct)]
84 - self.order = [chart for chart, choice in zip(ORDER, chart_choice) if choice]
107 + self.do_acct = self.configuration.get('acct', DEFAULT_DO_ACCT)
108 + self.do_proxy_auth = self.configuration.get('proxy_auth', DEFAULT_DO_PROXY_AUTH)
109 + self.do_proxy_acct = self.configuration.get('proxy_acct', DEFAULT_DO_PROXY_ACCT)
110 self.echo = find_binary('echo')
111 self.radclient = find_binary('radclient')
112 self.sub_echo = [self.echo, RADIUS_MSG]
88 - self.sub_radclient = [self.radclient, '-r', '1', '-t', '1', '-x',
89 - ':'.join([self.host, self.port]), 'status', self.secret]
113 + self.sub_radclient = radclient_status(
114 + self.radclient, RADCLIENT_RETRIES, RADCLIENT_TIMEOUT, self.host, self.port, self.secret,
115 + )
116
117 def check(self):
92 - if not all([self.echo, self.radclient]):
93 - self.error('Can\'t locate "radclient" binary or binary is not executable by netdata')
118 + if not self.radclient:
119 + self.error("Can't locate 'radclient' binary or binary is not executable by netdata user")
120 return False
121 +
122 + if not self.echo:
123 + self.error("Can't locate 'echo' binary or binary is not executable by netdata user")
124 + return None
125 +
126 if not self.secret:
96 - self.error('"secret" not set')
127 + self.error("'secret' isn't set")
128 return None
129
99 - if self._get_raw_data():
100 - return True
101 - self.error('Request returned no data. Is server alive?')
102 - return False
130 + if not self.get_raw_data():
131 + self.error('Request returned no data. Is server alive?')
132 + return False
133
104 - def _get_data(self):
134 + if not self.do_acct:
135 + self.order.remove('accounting')
136 +
137 + if not self.do_proxy_auth:
138 + self.order.remove('proxy-auth')
139 +
140 + if not self.do_proxy_acct:
141 + self.order.remove('proxy-acct')
142 +
143 + return True
144 +
145 + def get_data(self):
146 """
147 Format data received from shell command
148 :return: dict
149 """
109 - result = self._get_raw_data()
110 - return dict([(elem[0].lower(), int(elem[1])) for elem in findall(r'((?<=-)[AP][a-zA-Z-]+) = (\d+)', result)])
150 + result = self.get_raw_data()
151
112 - def _get_raw_data(self):
152 + if not result:
153 + return None
154 +
155 + return dict(
156 + (key.lower(), value) for key, value in PARSER.findall(result)
157 + )
158 +
159 + def get_raw_data(self):
160 """
161 The following code is equivalent to
162 'echo "Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 15, Response-Packet-Type = Access-Accept"
@@ -123,6 +170,8 @@ class Service(SimpleService):
170 raw_result = process_rad.communicate()[0]
171 except OSError:
172 return None
173 +
174 if process_rad.returncode is 0:
175 return raw_result.decode()
176 +
177 return None
collectors/python.d.plugin/go_expvar/go_expvar.chart.py
+15 -12
@@ -8,13 +8,20 @@ import json
8
9 from bases.FrameworkServices.UrlService import UrlService
10
11 -# default module values (can be overridden per job in `config`)
12 -# update_every = 2
13 -priority = 60000
11 +
12 +MEMSTATS_ORDER = [
13 + 'memstats_heap',
14 + 'memstats_stack',
15 + 'memstats_mspan',
16 + 'memstats_mcache',
17 + 'memstats_sys',
18 + 'memstats_live_objects',
19 + 'memstats_gc_pauses',
20 +]
21
22 MEMSTATS_CHARTS = {
23 'memstats_heap': {
17 - 'options': ['heap', 'memory: size of heap memory structures', 'kB', 'memstats',
24 + 'options': ['heap', 'memory: size of heap memory structures', 'KiB', 'memstats',
25 'expvar.memstats.heap', 'line'],
26 'lines': [
27 ['memstats_heap_alloc', 'alloc', 'absolute', 1, 1024],
@@ -22,21 +29,21 @@ MEMSTATS_CHARTS = {
29 ]
30 },
31 'memstats_stack': {
25 - 'options': ['stack', 'memory: size of stack memory structures', 'kB', 'memstats',
32 + 'options': ['stack', 'memory: size of stack memory structures', 'KiB', 'memstats',
33 'expvar.memstats.stack', 'line'],
34 'lines': [
35 ['memstats_stack_inuse', 'inuse', 'absolute', 1, 1024]
36 ]
37 },
38 'memstats_mspan': {
32 - 'options': ['mspan', 'memory: size of mspan memory structures', 'kB', 'memstats',
39 + 'options': ['mspan', 'memory: size of mspan memory structures', 'KiB', 'memstats',
40 'expvar.memstats.mspan', 'line'],
41 'lines': [
42 ['memstats_mspan_inuse', 'inuse', 'absolute', 1, 1024]
43 ]
44 },
45 'memstats_mcache': {
39 - 'options': ['mcache', 'memory: size of mcache memory structures', 'kB', 'memstats',
46 + 'options': ['mcache', 'memory: size of mcache memory structures', 'KiB', 'memstats',
47 'expvar.memstats.mcache', 'line'],
48 'lines': [
49 ['memstats_mcache_inuse', 'inuse', 'absolute', 1, 1024]
@@ -50,7 +57,7 @@ MEMSTATS_CHARTS = {
57 ]
58 },
59 'memstats_sys': {
53 - 'options': ['sys', 'memory: size of reserved virtual address space', 'kB', 'memstats',
60 + 'options': ['sys', 'memory: size of reserved virtual address space', 'KiB', 'memstats',
61 'expvar.memstats.sys', 'line'],
62 'lines': [
63 ['memstats_sys', 'sys', 'absolute', 1, 1024]
@@ -65,9 +72,6 @@ MEMSTATS_CHARTS = {
72 }
73 }
74
68 -MEMSTATS_ORDER = ['memstats_heap', 'memstats_stack', 'memstats_mspan', 'memstats_mcache',
69 - 'memstats_sys', 'memstats_live_objects', 'memstats_gc_pauses']
70 -
75
76 def flatten(d, top='', sep='.'):
77 items = []
@@ -83,7 +87,6 @@ def flatten(d, top='', sep='.'):
87 class Service(UrlService):
88 def __init__(self, configuration=None, name=None):
89 UrlService.__init__(self, configuration=configuration, name=name)
86 -
90 # if memstats collection is enabled, add the charts and their order
91 if self.configuration.get('collect_memstats'):
92 self.definitions = dict(MEMSTATS_CHARTS)
collectors/python.d.plugin/haproxy/haproxy.chart.py
+13 -19
@@ -14,11 +14,6 @@ except ImportError:
14 from bases.FrameworkServices.SocketService import SocketService
15 from bases.FrameworkServices.UrlService import UrlService
16
17 -
18 -# default module values (can be overridden per job in `config`)
19 -# update_every = 2
20 -priority = 60000
21 -
17 # charts order (can be overridden if you want less charts, or different order)
18 ORDER = [
19 'fbin',
@@ -55,11 +50,11 @@ ORDER = [
50
51 CHARTS = {
52 'fbin': {
58 - 'options': [None, 'Kilobytes In', 'KB/s', 'frontend', 'haproxy_f.bin', 'line'],
53 + 'options': [None, 'Kilobytes In', 'KiB/s', 'frontend', 'haproxy_f.bin', 'line'],
54 'lines': []
55 },
56 'fbout': {
62 - 'options': [None, 'Kilobytes Out', 'KB/s', 'frontend', 'haproxy_f.bout', 'line'],
57 + 'options': [None, 'Kilobytes Out', 'KiB/s', 'frontend', 'haproxy_f.bout', 'line'],
58 'lines': []
59 },
60 'fscur': {
@@ -100,11 +95,11 @@ CHARTS = {
95 'lines': []
96 },
97 'bbin': {
103 - 'options': [None, 'Kilobytes In', 'KB/s', 'backend', 'haproxy_b.bin', 'line'],
98 + 'options': [None, 'Kilobytes In', 'KiB/s', 'backend', 'haproxy_b.bin', 'line'],
99 'lines': []
100 },
101 'bbout': {
107 - 'options': [None, 'Kilobytes Out', 'KB/s', 'backend', 'haproxy_b.bout', 'line'],
102 + 'options': [None, 'Kilobytes Out', 'KiB/s', 'backend', 'haproxy_b.bout', 'line'],
103 'lines': []
104 },
105 'bscur': {
@@ -145,41 +140,39 @@ CHARTS = {
140 'lines': []
141 },
142 'bqtime': {
148 - 'options': [None, 'The average queue time over the 1024 last requests', 'ms', 'backend',
143 + 'options': [None, 'The average queue time over the 1024 last requests', 'milliseconds', 'backend',
144 'haproxy_b.qtime', 'line'],
145 'lines': []
146 },
147 'bctime': {
153 - 'options': [None, 'The average connect time over the 1024 last requests', 'ms', 'backend',
148 + 'options': [None, 'The average connect time over the 1024 last requests', 'milliseconds', 'backend',
149 'haproxy_b.ctime', 'line'],
150 'lines': []
151 },
152 'brtime': {
158 - 'options': [None, 'The average response time over the 1024 last requests', 'ms', 'backend',
153 + 'options': [None, 'The average response time over the 1024 last requests', 'milliseconds', 'backend',
154 'haproxy_b.rtime', 'line'],
155 'lines': []
156 },
157 'bttime': {
163 - 'options': [None, 'The average total session time over the 1024 last requests', 'ms', 'backend',
158 + 'options': [None, 'The average total session time over the 1024 last requests', 'milliseconds', 'backend',
159 'haproxy_b.ttime', 'line'],
160 'lines': []
161 },
162 'health_sdown': {
168 - 'options': [None, 'Backend Servers In DOWN State', 'failed servers', 'health',
169 - 'haproxy_hs.down', 'line'],
163 + 'options': [None, 'Backend Servers In DOWN State', 'failed servers', 'health', 'haproxy_hs.down', 'line'],
164 'lines': []
165 },
166 'health_sup': {
173 - 'options': [None, 'Backend Servers In UP State', 'health servers', 'health',
174 - 'haproxy_hs.up', 'line'],
167 + 'options': [None, 'Backend Servers In UP State', 'health servers', 'health', 'haproxy_hs.up', 'line'],
168 'lines': []
169 },
170 'health_bdown': {
178 - 'options': [None, 'Is Backend Alive? 1 = DOWN', 'failed backend', 'health', 'haproxy_hb.down', 'line'],
171 + 'options': [None, 'Is Backend Failed?', 'boolean', 'health', 'haproxy_hb.down', 'line'],
172 'lines': []
173 },
174 'health_idle': {
182 - 'options': [None, 'The Ratio Of Polling Time Vs Total Time', 'percent', 'health', 'haproxy.idle', 'line'],
175 + 'options': [None, 'The Ratio Of Polling Time Vs Total Time', 'percentage', 'health', 'haproxy.idle', 'line'],
176 'lines': [
177 ['idle', None, 'absolute']
178 ]
@@ -213,6 +206,7 @@ REGEX = dict(url=re_compile(r'idle = (?P<idle>[0-9]+)'),
206 socket=re_compile(r'Idle_pct: (?P<idle>[0-9]+)'))
207
208
209 +# TODO: the code is unreadable
210 class Service(UrlService, SocketService):
211 def __init__(self, configuration=None, name=None):
212 if 'socket' in configuration:
collectors/python.d.plugin/hddtemp/hddtemp.chart.py
+4 -2
@@ -12,7 +12,9 @@ from copy import deepcopy
12 from bases.FrameworkServices.SocketService import SocketService
13
14
15 -ORDER = ['temperatures']
15 +ORDER = [
16 + 'temperatures',
17 +]
18
19 CHARTS = {
20 'temperatures': {
@@ -39,11 +41,11 @@ class Service(SocketService):
41 SocketService.__init__(self, configuration=configuration, name=name)
42 self.order = ORDER
43 self.definitions = deepcopy(CHARTS)
44 + self.do_only = self.configuration.get('devices')
45 self._keep_alive = False
46 self.request = ""
47 self.host = "127.0.0.1"
48 self.port = 7634
46 - self.do_only = self.configuration.get('devices')
49
50 def get_disks(self):
51 r = self._get_raw_data()
collectors/python.d.plugin/httpcheck/httpcheck.chart.py
+8 -4
@@ -28,11 +28,15 @@ HTTP_BAD_STATUS = 'bad_status'
28 HTTP_TIMEOUT = 'timeout'
29 HTTP_NO_CONNECTION = 'no_connection'
30
31 -ORDER = ['response_time', 'response_length', 'status']
31 +ORDER = [
32 + 'response_time',
33 + 'response_length',
34 + 'status',
35 +]
36
37 CHARTS = {
38 'response_time': {
35 - 'options': [None, 'HTTP response time', 'ms', 'response', 'httpcheck.responsetime', 'line'],
39 + 'options': [None, 'HTTP response time', 'milliseconds', 'response', 'httpcheck.responsetime', 'line'],
40 'lines': [
41 [HTTP_RESPONSE_TIME, 'time', 'absolute', 100, 1000]
42 ]
@@ -59,12 +63,12 @@ CHARTS = {
63 class Service(UrlService):
64 def __init__(self, configuration=None, name=None):
65 UrlService.__init__(self, configuration=configuration, name=name)
66 + self.order = ORDER
67 + self.definitions = CHARTS
68 pattern = self.configuration.get('regex')
69 self.regex = re.compile(pattern) if pattern else None
70 self.status_codes_accepted = self.configuration.get('status_accepted', [200])
71 self.follow_redirect = self.configuration.get('redirect', True)
66 - self.order = ORDER
67 - self.definitions = CHARTS
72
73 def _get_data(self):
74 """
collectors/python.d.plugin/icecast/icecast.chart.py
+3 -4
@@ -8,10 +8,9 @@ import json
8 from bases.FrameworkServices.UrlService import UrlService
9
10
11 -priority = 60000
12 -
13 -# charts order (can be overridden if you want less charts, or different order)
14 -ORDER = ['listeners']
11 +ORDER = [
12 + 'listeners',
13 +]
14
15 CHARTS = {
16 'listeners': {
collectors/python.d.plugin/ipfs/ipfs.chart.py
+12 -19
@@ -7,24 +7,17 @@ import json
7
8 from bases.FrameworkServices.UrlService import UrlService
9
10 -# default module values (can be overridden per job in `config`)
11 -# update_every = 2
12 -priority = 60000
10
14 -# default job configuration (overridden by python.d.plugin)
15 -# config = {'local': {
16 -# 'update_every': update_every,
17 -# 'retries': retries,
18 -# 'priority': priority,
19 -# 'url': 'http://localhost:5001'
20 -# }}
21 -
22 -# charts order (can be overridden if you want less charts, or different order)
23 -ORDER = ['bandwidth', 'peers', 'repo_size', 'repo_objects']
11 +ORDER = [
12 + 'bandwidth',
13 + 'peers',
14 + 'repo_size',
15 + 'repo_objects',
16 +]
17
18 CHARTS = {
19 'bandwidth': {
27 - 'options': [None, 'IPFS Bandwidth', 'kbits/s', 'Bandwidth', 'ipfs.bandwidth', 'line'],
20 + 'options': [None, 'IPFS Bandwidth', 'kilobits/s', 'Bandwidth', 'ipfs.bandwidth', 'line'],
21 'lines': [
22 ['in', None, 'absolute', 8, 1000],
23 ['out', None, 'absolute', -8, 1000]
@@ -37,10 +30,10 @@ CHARTS = {
30 ]
31 },
32 'repo_size': {
40 - 'options': [None, 'IPFS Repo Size', 'GB', 'Size', 'ipfs.repo_size', 'area'],
33 + 'options': [None, 'IPFS Repo Size', 'GiB', 'Size', 'ipfs.repo_size', 'area'],
34 'lines': [
42 - ['avail', None, 'absolute', 1, 1e9],
43 - ['size', None, 'absolute', 1, 1e9],
35 + ['avail', None, 'absolute', 1, 1 << 30],
36 + ['size', None, 'absolute', 1, 1 << 30],
37 ]
38 },
39 'repo_objects': {
@@ -68,11 +61,11 @@ SI_zeroes = {
61 class Service(UrlService):
62 def __init__(self, configuration=None, name=None):
63 UrlService.__init__(self, configuration=configuration, name=name)
71 - self.baseurl = self.configuration.get('url', 'http://localhost:5001')
64 self.order = ORDER
65 self.definitions = CHARTS
74 - self.__storage_max = None
66 + self.baseurl = self.configuration.get('url', 'http://localhost:5001')
67 self.do_pinapi = self.configuration.get('pinapi')
68 + self.__storage_max = None
69
70 def _get_json(self, sub_url):
71 """
collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py
+21 -9
@@ -19,14 +19,16 @@ from copy import deepcopy
19
20 from bases.FrameworkServices.SimpleService import SimpleService
21
22 -priority = 60000
23 -retries = 60
22
25 -ORDER = ['pools_utilization', 'pools_active_leases', 'leases_total']
23 +ORDER = [
24 + 'pools_utilization',
25 + 'pools_active_leases',
26 + 'leases_total',
27 +]
28
29 CHARTS = {
30 'pools_utilization': {
29 - 'options': [None, 'Pools Utilization', '%', 'utilization', 'isc_dhcpd.utilization', 'line'],
31 + 'options': [None, 'Pools Utilization', 'percentage', 'utilization', 'isc_dhcpd.utilization', 'line'],
32 'lines': []
33 },
34 'pools_active_leases': {
@@ -120,7 +122,6 @@ class Service(SimpleService):
122 SimpleService.__init__(self, configuration=configuration, name=name)
123 self.order = ORDER
124 self.definitions = deepcopy(CHARTS)
123 -
125 lease_path = self.configuration.get('leases_path', '/var/lib/dhcp/dhcpd.leases')
126 self.dhcpd_leases = DhcpdLeasesFile(path=lease_path)
127 self.pools = list()
@@ -131,7 +132,7 @@ class Service(SimpleService):
132
133 def check(self):
134 if not HAVE_IP_ADDRESS:
134 - self.error("'python-ipaddress' module is needed")
135 + self.error("'python-ipaddress' package is needed")
136 return False
137
138 if not self.dhcpd_leases.is_valid():
@@ -190,6 +191,17 @@ class Service(SimpleService):
191
192 def create_charts(self):
193 for pool in self.pools:
193 - self.definitions['pools_utilization']['lines'].append([pool.id + '_utilization', pool.name,
194 - 'absolute', 1, 100])
195 - self.definitions['pools_active_leases']['lines'].append([pool.id + '_active_leases', pool.name])
194 + dim = [
195 + pool.id + '_utilization',
196 + pool.name,
197 + 'absolute',
198 + 1,
199 + 100,
200 + ]
201 + self.definitions['pools_utilization']['lines'].append(dim)
202 +
203 + dim = [
204 + pool.id + '_active_leases',
205 + pool.name,
206 + ]
207 + self.definitions['pools_active_leases']['lines'].append(dim)
collectors/python.d.plugin/litespeed/litespeed.chart.py
+9 -5
@@ -16,11 +16,15 @@ update_every = 10
16
17 # charts order (can be overridden if you want less charts, or different order)
18 ORDER = [
19 - 'net_throughput_http', 'net_throughput_https', # net throughput
20 - 'connections_http', 'connections_https', # connections
21 - 'requests', 'requests_processing', # requests
22 - 'pub_cache_hits', 'private_cache_hits', # cache
23 - 'static_hits' # static
19 + 'net_throughput_http', # net throughput
20 + 'net_throughput_https', # net throughput
21 + 'connections_http', # connections
22 + 'connections_https', # connections
23 + 'requests', # requests
24 + 'requests_processing', # requests
25 + 'pub_cache_hits', # cache
26 + 'private_cache_hits', # cache
27 + 'static_hits', # static
28 ]
29
30 CHARTS = {
collectors/python.d.plugin/logind/logind.chart.py
+8 -2
@@ -8,7 +8,13 @@ from bases.FrameworkServices.ExecutableService import ExecutableService
8 priority = 59999
9 disabled_by_default = True
10
11 -ORDER = ['sessions', 'users', 'seats']
11 +LOGINCTL_COMMAND = 'loginctl list-sessions --no-legend'
12 +
13 +ORDER = [
14 + 'sessions',
15 + 'users',
16 + 'seats',
17 +]
18
19 CHARTS = {
20 'sessions': {
@@ -39,9 +45,9 @@ CHARTS = {
45 class Service(ExecutableService):
46 def __init__(self, configuration=None, name=None):
47 ExecutableService.__init__(self, configuration=configuration, name=name)
42 - self.command = 'loginctl list-sessions --no-legend'
48 self.order = ORDER
49 self.definitions = CHARTS
50 + self.command = LOGINCTL_COMMAND
51
52 def _get_data(self):
53 ret = {
collectors/python.d.plugin/megacli/megacli.chart.py
+2 -2
@@ -66,7 +66,7 @@ def battery_charts(bats):
66 charts.update(
67 {
68 'bbu_{0}_relative_charge'.format(b.id): {
69 - 'options': [None, 'Relative State of Charge', '%', 'battery',
69 + 'options': [None, 'Relative State of Charge', 'percentage', 'battery',
70 'megacli.bbu_relative_charge', 'line'],
71 'lines': [
72 ['bbu_{0}_relative_charge'.format(b.id), 'adapter {0}'.format(b.id)],
@@ -180,8 +180,8 @@ class Service(ExecutableService):
180 ExecutableService.__init__(self, configuration=configuration, name=name)
181 self.order = list()
182 self.definitions = dict()
183 - self.megacli = Megacli()
183 self.do_battery = self.configuration.get('do_battery')
184 + self.megacli = Megacli()
185
186 def check_sudo(self):
187 err = self._get_raw_data(command=self.megacli.sudo_check, stderr=True)
collectors/python.d.plugin/memcached/memcached.chart.py
+24 -23
@@ -5,36 +5,37 @@
5
6 from bases.FrameworkServices.SocketService import SocketService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 2
10 -priority = 60000
11 -
12 -# default job configuration (overridden by python.d.plugin)
13 -# config = {'local': {
14 -# 'update_every': update_every,
15 -# 'retries': retries,
16 -# 'priority': priority,
17 -# 'host': 'localhost',
18 -# 'port': 11211,
19 -# 'unix_socket': None
20 -# }}
21 -
22 -ORDER = ['cache', 'net', 'connections', 'items', 'evicted_reclaimed',
23 - 'get', 'get_rate', 'set_rate', 'cas', 'delete', 'increment', 'decrement', 'touch', 'touch_rate']
8 +
9 +ORDER = [
10 + 'cache',
11 + 'net',
12 + 'connections',
13 + 'items',
14 + 'evicted_reclaimed',
15 + 'get',
16 + 'get_rate',
17 + 'set_rate',
18 + 'cas',
19 + 'delete',
20 + 'increment',
21 + 'decrement',
22 + 'touch',
23 + 'touch_rate',
24 +]
25
26 CHARTS = {
27 'cache': {
27 - 'options': [None, 'Cache Size', 'megabytes', 'cache', 'memcached.cache', 'stacked'],
28 + 'options': [None, 'Cache Size', 'MiB', 'cache', 'memcached.cache', 'stacked'],
29 'lines': [
29 - ['avail', 'available', 'absolute', 1, 1048576],
30 - ['used', 'used', 'absolute', 1, 1048576]
30 + ['avail', 'available', 'absolute', 1, 1 << 20],
31 + ['used', 'used', 'absolute', 1, 1 << 20]
32 ]
33 },
34 'net': {
35 'options': [None, 'Network', 'kilobits/s', 'network', 'memcached.net', 'area'],
36 'lines': [
36 - ['bytes_read', 'in', 'incremental', 8, 1024],
37 - ['bytes_written', 'out', 'incremental', -8, 1024]
37 + ['bytes_read', 'in', 'incremental', 8, 1000],
38 + ['bytes_written', 'out', 'incremental', -8, 1000],
39 ]
40 },
41 'connections': {
@@ -126,13 +127,13 @@ CHARTS = {
127 class Service(SocketService):
128 def __init__(self, configuration=None, name=None):
129 SocketService.__init__(self, configuration=configuration, name=name)
130 + self.order = ORDER
131 + self.definitions = CHARTS
132 self.request = 'stats\r\n'
133 self.host = 'localhost'
134 self.port = 11211
135 self._keep_alive = True
136 self.unix_socket = None
134 - self.order = ORDER
135 - self.definitions = CHARTS
137
138 def _get_data(self):
139 """
collectors/python.d.plugin/mongodb/mongodb.chart.py
+9 -13
@@ -16,10 +16,6 @@ except ImportError:
16
17 from bases.FrameworkServices.SimpleService import SimpleService
18
19 -# default module values (can be overridden per job in `config`)
20 -# update_every = 2
21 -priority = 60000
22 -retries = 60
19
20 REPL_SET_STATES = [
21 ('1', 'primary'),
@@ -209,21 +205,21 @@ CHARTS = {
205 ]
206 },
207 'journaling_volume': {
212 - 'options': [None, 'Volume of data written to the journal', 'MB', 'database performance',
208 + 'options': [None, 'Volume of data written to the journal', 'MiB', 'database performance',
209 'mongodb.journaling_volume', 'line'],
210 'lines': [
211 ['journaledMB', 'volume', 'absolute', 1, 100]
212 ]
213 },
214 'background_flush_average': {
219 - 'options': [None, 'Average time taken by flushes to execute', 'ms', 'database performance',
215 + 'options': [None, 'Average time taken by flushes to execute', 'milliseconds', 'database performance',
216 'mongodb.background_flush_average', 'line'],
217 'lines': [
218 ['average_ms', 'time', 'absolute', 1, 100]
219 ]
220 },
221 'background_flush_last': {
226 - 'options': [None, 'Time taken by the last flush operation to execute', 'ms', 'database performance',
222 + 'options': [None, 'Time taken by the last flush operation to execute', 'milliseconds', 'database performance',
223 'mongodb.background_flush_last', 'line'],
224 'lines': [
225 ['last_ms', 'time', 'absolute', 1, 100]
@@ -269,7 +265,7 @@ CHARTS = {
265 ]
266 },
267 'memory': {
272 - 'options': [None, 'Memory metrics', 'MB', 'resource utilization', 'mongodb.memory', 'stacked'],
268 + 'options': [None, 'Memory metrics', 'MiB', 'resource utilization', 'mongodb.memory', 'stacked'],
269 'lines': [
270 ['virtual', None, 'absolute', 1, 1],
271 ['resident', None, 'absolute', 1, 1],
@@ -313,7 +309,7 @@ CHARTS = {
309 },
310 'wiredtiger_cache': {
311 'options': [None, 'The percentage of the wiredTiger cache that is in use and cache with dirty bytes',
316 - 'percent', 'resource utilization', 'mongodb.wiredtiger_cache', 'stacked'],
312 + 'percentage', 'resource utilization', 'mongodb.wiredtiger_cache', 'stacked'],
313 'lines': [
314 ['wiredTiger_percent_clean', 'inuse', 'absolute', 1, 1000],
315 ['wiredTiger_percent_dirty', 'dirty', 'absolute', 1, 1000]
@@ -333,14 +329,14 @@ CHARTS = {
329 'lines': []
330 },
331 'tcmalloc_generic': {
336 - 'options': [None, 'Tcmalloc generic metrics', 'MB', 'tcmalloc', 'mongodb.tcmalloc_generic', 'stacked'],
332 + 'options': [None, 'Tcmalloc generic metrics', 'MiB', 'tcmalloc', 'mongodb.tcmalloc_generic', 'stacked'],
333 'lines': [
338 - ['current_allocated_bytes', 'allocated', 'absolute', 1, 1048576],
339 - ['heap_size', 'heap_size', 'absolute', 1, 1048576]
334 + ['current_allocated_bytes', 'allocated', 'absolute', 1, 1 << 20],
335 + ['heap_size', 'heap_size', 'absolute', 1, 1 << 20]
336 ]
337 },
338 'tcmalloc_metrics': {
343 - 'options': [None, 'Tcmalloc metrics', 'KB', 'tcmalloc', 'mongodb.tcmalloc_metrics', 'stacked'],
339 + 'options': [None, 'Tcmalloc metrics', 'KiB', 'tcmalloc', 'mongodb.tcmalloc_metrics', 'stacked'],
340 'lines': [
341 ['central_cache_free_bytes', 'central_cache_free', 'absolute', 1, 1024],
342 ['current_total_thread_cache_bytes', 'current_total_thread_cache', 'absolute', 1, 1024],
collectors/python.d.plugin/monit/monit.chart.py
+19 -6
@@ -6,12 +6,20 @@
6 import xml.etree.ElementTree as ET
7 from bases.FrameworkServices.UrlService import UrlService
8
9 -# default module values (can be overridden per job in `config`)
10 -# update_every = 2
11 -priority = 60000
9
10 # see enum State_Type from monit.h (https://bitbucket.org/tildeslash/monit/src/master/src/monit.h)
14 -MONIT_SERVICE_NAMES = ['Filesystem', 'Directory', 'File', 'Process', 'Host', 'System', 'Fifo', 'Program', 'Net']
11 +MONIT_SERVICE_NAMES = [
12 + 'Filesystem',
13 + 'Directory',
14 + 'File',
15 + 'Process',
16 + 'Host',
17 + 'System',
18 + 'Fifo',
19 + 'Program',
20 + 'Net',
21 +]
22 +
23 DEFAULT_SERVICES_IDS = [0, 1, 2, 3, 4, 6, 7, 8]
24
25 # charts order (can be overridden if you want less charts, or different order)
@@ -89,10 +97,10 @@ CHARTS = {
97 class Service(UrlService):
98 def __init__(self, configuration=None, name=None):
99 UrlService.__init__(self, configuration=configuration, name=name)
92 - base_url = self.configuration.get('url', 'http://localhost:2812')
93 - self.url = '{0}/_status?format=xml&level=full'.format(base_url)
100 self.order = ORDER
101 self.definitions = CHARTS
102 + base_url = self.configuration.get('url', 'http://localhost:2812')
103 + self.url = '{0}/_status?format=xml&level=full'.format(base_url)
104
105 def parse(self, data):
106 try:
@@ -104,15 +112,19 @@ class Service(UrlService):
112
113 def check(self):
114 self._manager = self._build_manager()
115 +
116 raw_data = self._get_raw_data()
117 if not raw_data:
118 return None
119 +
120 return bool(self.parse(raw_data))
121
122 def _get_data(self):
123 raw_data = self._get_raw_data()
124 +
125 if not raw_data:
126 return None
127 +
128 xml = self.parse(raw_data)
129 if not xml:
130 return None
@@ -120,6 +132,7 @@ class Service(UrlService):
132 data = {}
133 for service_id in DEFAULT_SERVICES_IDS:
134 service_category = MONIT_SERVICE_NAMES[service_id].lower()
135 +
136 if service_category == 'system':
137 self.debug("Skipping service from 'System' category, because it's useless in graphs")
138 continue
collectors/python.d.plugin/mysql/mysql.chart.py
+12 -11
@@ -6,9 +6,6 @@
6
7 from bases.FrameworkServices.MySQLService import MySQLService
8
9 -# default module values (can be overridden per job in `config`)
10 -# update_every = 3
11 -priority = 60000
9
10 # query executed on MySQL server
11 QUERY_GLOBAL = 'SHOW GLOBAL STATUS;'
@@ -207,8 +204,8 @@ CHARTS = {
204 'net': {
205 'options': [None, 'mysql Bandwidth', 'kilobits/s', 'bandwidth', 'mysql.net', 'area'],
206 'lines': [
210 - ['Bytes_received', 'in', 'incremental', 8, 1024],
211 - ['Bytes_sent', 'out', 'incremental', -8, 1024]
207 + ['Bytes_received', 'in', 'incremental', 8, 1000],
208 + ['Bytes_sent', 'out', 'incremental', -8, 1000]
209 ]
210 },
211 'queries': {
@@ -320,7 +317,7 @@ CHARTS = {
317 ]
318 },
319 'innodb_io': {
323 - 'options': [None, 'mysql InnoDB I/O Bandwidth', 'kilobytes/s', 'innodb', 'mysql.innodb_io', 'area'],
320 + 'options': [None, 'mysql InnoDB I/O Bandwidth', 'KiB/s', 'innodb', 'mysql.innodb_io', 'area'],
321 'lines': [
322 ['Innodb_data_read', 'read', 'incremental', 1, 1024],
323 ['Innodb_data_written', 'write', 'incremental', -1, 1024]
@@ -360,7 +357,7 @@ CHARTS = {
357 ]
358 },
359 'innodb_os_log_io': {
363 - 'options': [None, 'mysql InnoDB OS Log Bandwidth', 'kilobytes/s', 'innodb', 'mysql.innodb_os_log_io', 'area'],
360 + 'options': [None, 'mysql InnoDB OS Log Bandwidth', 'KiB/s', 'innodb', 'mysql.innodb_os_log_io', 'area'],
361 'lines': [
362 ['Innodb_os_log_written', 'write', 'incremental', -1, 1024],
363 ]
@@ -394,7 +391,7 @@ CHARTS = {
391 ]
392 },
393 'innodb_buffer_pool_bytes': {
397 - 'options': [None, 'mysql InnoDB Buffer Pool Bytes', 'MB', 'innodb', 'mysql.innodb_buffer_pool_bytes', 'area'],
394 + 'options': [None, 'mysql InnoDB Buffer Pool Bytes', 'MiB', 'innodb', 'mysql.innodb_buffer_pool_bytes', 'area'],
395 'lines': [
396 ['Innodb_buffer_pool_bytes_data', 'data', 'absolute', 1, 1024 * 1024],
397 ['Innodb_buffer_pool_bytes_dirty', 'dirty', 'absolute', -1, 1024 * 1024]
@@ -441,7 +438,7 @@ CHARTS = {
438 ]
439 },
440 'qcache_freemem': {
444 - 'options': [None, 'mysql QCache Free Memory', 'MB', 'qcache', 'mysql.qcache_freemem', 'area'],
441 + 'options': [None, 'mysql QCache Free Memory', 'MiB', 'qcache', 'mysql.qcache_freemem', 'area'],
442 'lines': [
443 ['Qcache_free_memory', 'free', 'absolute', 1, 1024 * 1024]
444 ]
@@ -529,7 +526,7 @@ CHARTS = {
526 ]
527 },
528 'galera_bytes': {
532 - 'options': [None, 'Replicated bytes', 'KB/s', 'galera', 'mysql.galera_bytes', 'area'],
529 + 'options': [None, 'Replicated bytes', 'KiB/s', 'galera', 'mysql.galera_bytes', 'area'],
530 'lines': [
531 ['wsrep_received_bytes', 'rx', 'incremental', 1, 1024],
532 ['wsrep_replicated_bytes', 'tx', 'incremental', -1, 1024],
@@ -563,7 +560,11 @@ class Service(MySQLService):
560 MySQLService.__init__(self, configuration=configuration, name=name)
561 self.order = ORDER
562 self.definitions = CHARTS
566 - self.queries = dict(global_status=QUERY_GLOBAL, slave_status=QUERY_SLAVE, variables=QUERY_VARIABLES)
563 + self.queries = dict(
564 + global_status=QUERY_GLOBAL,
565 + slave_status=QUERY_SLAVE,
566 + variables=QUERY_VARIABLES,
567 + )
568
569 def _get_data(self):
570
collectors/python.d.plugin/nginx/nginx.chart.py
+11 -18
@@ -5,37 +5,30 @@
5
6 from bases.FrameworkServices.UrlService import UrlService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 2
10 -priority = 60000
8
12 -# default job configuration (overridden by python.d.plugin)
13 -# config = {'local': {
14 -# 'update_every': update_every,
15 -# 'retries': retries,
16 -# 'priority': priority,
17 -# 'url': 'http://localhost/stub_status'
18 -# }}
19 -
20 -# charts order (can be overridden if you want less charts, or different order)
21 -ORDER = ['connections', 'requests', 'connection_status', 'connect_rate']
9 +ORDER = [
10 + 'connections',
11 + 'requests',
12 + 'connection_status',
13 + 'connect_rate',
14 +]
15
16 CHARTS = {
17 'connections': {
25 - 'options': [None, 'nginx Active Connections', 'connections', 'active connections',
18 + 'options': [None, 'Active Connections', 'connections', 'active connections',
19 'nginx.connections', 'line'],
20 'lines': [
21 ['active']
22 ]
23 },
24 'requests': {
32 - 'options': [None, 'nginx Requests', 'requests/s', 'requests', 'nginx.requests', 'line'],
25 + 'options': [None, 'Requests', 'requests/s', 'requests', 'nginx.requests', 'line'],
26 'lines': [
27 ['requests', None, 'incremental']
28 ]
29 },
30 'connection_status': {
38 - 'options': [None, 'nginx Active Connections by Status', 'connections', 'status',
31 + 'options': [None, 'Active Connections by Status', 'connections', 'status',
32 'nginx.connection_status', 'line'],
33 'lines': [
34 ['reading'],
@@ -44,7 +37,7 @@ CHARTS = {
37 ]
38 },
39 'connect_rate': {
47 - 'options': [None, 'nginx Connections Rate', 'connections/s', 'connections rate',
40 + 'options': [None, 'Connections Rate', 'connections/s', 'connections rate',
41 'nginx.connect_rate', 'line'],
42 'lines': [
43 ['accepts', 'accepted', 'incremental'],
@@ -57,9 +50,9 @@ CHARTS = {
50 class Service(UrlService):
51 def __init__(self, configuration=None, name=None):
52 UrlService.__init__(self, configuration=configuration, name=name)
60 - self.url = self.configuration.get('url', 'http://localhost/stub_status')
53 self.order = ORDER
54 self.definitions = CHARTS
55 + self.url = self.configuration.get('url', 'http://localhost/stub_status')
56
57 def _get_data(self):
58 """
collectors/python.d.plugin/nginx_plus/nginx_plus.chart.py
+7 -10
@@ -16,11 +16,7 @@ except ImportError:
16
17 from bases.FrameworkServices.UrlService import UrlService
18
19 -# default module values (can be overridden per job in `config`)
20 -update_every = 1
21 -priority = 60000
19
23 -# charts order (can be overridden if you want less charts, or different order)
20 ORDER = [
21 'requests_total',
22 'requests_current',
@@ -75,7 +71,7 @@ CHARTS = {
71 ]
72 },
73 'ssl_memory_usage': {
78 - 'options': [None, 'Memory Usage', '%', 'ssl', 'nginx_plus.ssl_memory_usage', 'area'],
74 + 'options': [None, 'Memory Usage', 'percentage', 'ssl', 'nginx_plus.ssl_memory_usage', 'area'],
75 'lines': [
76 ['ssl_memory_usage', 'usage', 'absolute', 1, 100]
77 ]
@@ -94,7 +90,7 @@ def cache_charts(cache):
90 charts = OrderedDict()
91
92 charts['{0}_traffic'.format(cache.name)] = {
97 - 'options': [None, 'Traffic', 'KB', family, 'nginx_plus.cache_traffic', 'stacked'],
93 + 'options': [None, 'Traffic', 'KiB', family, 'nginx_plus.cache_traffic', 'stacked'],
94 'lines': [
95 ['_'.join([cache.name, 'hit_bytes']), 'served', 'absolute', 1, 1024],
96 ['_'.join([cache.name, 'miss_bytes_written']), 'written', 'absolute', 1, 1024],
@@ -102,7 +98,7 @@ def cache_charts(cache):
98 ]
99 }
100 charts['{0}_memory_usage'.format(cache.name)] = {
105 - 'options': [None, 'Memory Usage', '%', family, 'nginx_plus.cache_memory_usage', 'area'],
101 + 'options': [None, 'Memory Usage', 'percentage', family, 'nginx_plus.cache_memory_usage', 'area'],
102 'lines': [
103 ['_'.join([cache.name, 'memory_usage']), 'usage', 'absolute', 1, 100],
104 ]
@@ -199,7 +195,8 @@ def web_upstream_charts(wu):
195 'lines': dimensions('active')
196 }
197 charts['web_upstream_{name}_connections_usage'.format(name=wu.name)] = {
202 - 'options': [None, 'Peers Connections Usage', '%', family, 'nginx_plus.web_upstream_connections_usage', 'line'],
198 + 'options': [None, 'Peers Connections Usage', 'percentage', family,
199 + 'nginx_plus.web_upstream_connections_usage', 'line'],
200 'lines': dimensions('connections_usage', d=100)
201 }
202 # Traffic
@@ -222,7 +219,7 @@ def web_upstream_charts(wu):
219 # Response Time
220 for peer in wu:
221 charts['web_upstream_{0}_{1}_timings'.format(wu.name, peer.server)] = {
225 - 'options': [None, 'Peer "{0}" Timings'.format(peer.real_server), 'ms', family,
222 + 'options': [None, 'Peer "{0}" Timings'.format(peer.real_server), 'milliseconds', family,
223 'nginx_plus.web_upstream_peer_timings', 'line'],
224 'lines': [
225 ['_'.join([wu.name, peer.server, 'header_time']), 'header'],
@@ -231,7 +228,7 @@ def web_upstream_charts(wu):
228 }
229 # Memory Usage
230 charts['web_upstream_{name}_memory_usage'.format(name=wu.name)] = {
234 - 'options': [None, 'Memory Usage', '%', family, 'nginx_plus.web_upstream_memory_usage', 'area'],
231 + 'options': [None, 'Memory Usage', 'percentage', family, 'nginx_plus.web_upstream_memory_usage', 'area'],
232 'lines': [
233 ['_'.join([wu.name, 'memory_usage']), 'usage', 'absolute', 1, 100]
234 ]
collectors/python.d.plugin/nsd/nsd.chart.py
+18 -11
@@ -7,12 +7,20 @@ import re
7
8 from bases.FrameworkServices.ExecutableService import ExecutableService
9
10 -# default module values (can be overridden per job in `config`)
11 -priority = 60000
10 +
11 update_every = 30
12
14 -# charts order (can be overridden if you want less charts, or different order)
15 -ORDER = ['queries', 'zones', 'protocol', 'type', 'transfer', 'rcode']
13 +NSD_CONTROL_COMMAND = 'nsd-control stats_noreset'
14 +REGEX = re.compile(r'([A-Za-z0-9.]+)=(\d+)')
15 +
16 +ORDER = [
17 + 'queries',
18 + 'zones',
19 + 'protocol',
20 + 'type',
21 + 'transfer',
22 + 'rcode',
23 +]
24
25 CHARTS = {
26 'queries': {
@@ -78,22 +86,21 @@ CHARTS = {
86
87 class Service(ExecutableService):
88 def __init__(self, configuration=None, name=None):
81 - ExecutableService.__init__(
82 - self, configuration=configuration, name=name)
83 - self.command = 'nsd-control stats_noreset'
89 + ExecutableService.__init__(self, configuration=configuration, name=name)
90 self.order = ORDER
91 self.definitions = CHARTS
86 - self.regex = re.compile(r'([A-Za-z0-9.]+)=(\d+)')
92 + self.command = NSD_CONTROL_COMMAND
93
94 def _get_data(self):
95 lines = self._get_raw_data()
96 if not lines:
97 return None
98
93 - r = self.regex
94 - stats = dict((k.replace('.', '_'), int(v))
95 - for k, v in r.findall(''.join(lines)))
99 + stats = dict(
100 + (k.replace('.', '_'), int(v)) for k, v in REGEX.findall(''.join(lines))
101 + )
102 stats.setdefault('num_opcode_NOTIFY', 0)
103 stats.setdefault('num_type_TYPE252', 0)
104 stats.setdefault('num_type_TYPE255', 0)
105 +
106 return stats
collectors/python.d.plugin/ntpd/ntpd.chart.py
+12 -15
@@ -9,9 +9,6 @@ import re
9
10 from bases.FrameworkServices.SocketService import SocketService
11
12 -# default module values
13 -update_every = 1
14 -priority = 60000
12
13 # NTP Control Message Protocol constants
14 MODE = 6
@@ -53,13 +50,15 @@ ORDER = [
50
51 CHARTS = {
52 'sys_offset': {
56 - 'options': [None, 'Combined offset of server relative to this host', 'ms', 'system', 'ntpd.sys_offset', 'area'],
53 + 'options': [None, 'Combined offset of server relative to this host', 'milliseconds',
54 + 'system', 'ntpd.sys_offset', 'area'],
55 'lines': [
56 ['offset', 'offset', 'absolute', 1, PRECISION]
57 ]
58 },
59 'sys_jitter': {
62 - 'options': [None, 'Combined system jitter and clock jitter', 'ms', 'system', 'ntpd.sys_jitter', 'line'],
60 + 'options': [None, 'Combined system jitter and clock jitter', 'milliseconds',
61 + 'system', 'ntpd.sys_jitter', 'line'],
62 'lines': [
63 ['sys_jitter', 'system', 'absolute', 1, PRECISION],
64 ['clk_jitter', 'clock', 'absolute', 1, PRECISION]
@@ -78,14 +77,14 @@ CHARTS = {
77 ]
78 },
79 'sys_rootdelay': {
81 - 'options': [None, 'Total roundtrip delay to the primary reference clock', 'ms', 'system',
80 + 'options': [None, 'Total roundtrip delay to the primary reference clock', 'milliseconds', 'system',
81 'ntpd.sys_rootdelay', 'area'],
82 'lines': [
83 ['rootdelay', 'delay', 'absolute', 1, PRECISION]
84 ]
85 },
86 'sys_rootdisp': {
88 - 'options': [None, 'Total root dispersion to the primary reference clock', 'ms', 'system',
87 + 'options': [None, 'Total root dispersion to the primary reference clock', 'milliseconds', 'system',
88 'ntpd.sys_rootdisp', 'area'],
89 'lines': [
90 ['rootdisp', 'dispersion', 'absolute', 1, PRECISION]
@@ -114,27 +113,27 @@ CHARTS = {
113
114 PEER_CHARTS = {
115 'peer_offset': {
117 - 'options': [None, 'Filter offset', 'ms', 'peers', 'ntpd.peer_offset', 'line'],
116 + 'options': [None, 'Filter offset', 'milliseconds', 'peers', 'ntpd.peer_offset', 'line'],
117 'lines': []
118 },
119 'peer_delay': {
121 - 'options': [None, 'Filter delay', 'ms', 'peers', 'ntpd.peer_delay', 'line'],
120 + 'options': [None, 'Filter delay', 'milliseconds', 'peers', 'ntpd.peer_delay', 'line'],
121 'lines': []
122 },
123 'peer_dispersion': {
125 - 'options': [None, 'Filter dispersion', 'ms', 'peers', 'ntpd.peer_dispersion', 'line'],
124 + 'options': [None, 'Filter dispersion', 'milliseconds', 'peers', 'ntpd.peer_dispersion', 'line'],
125 'lines': []
126 },
127 'peer_jitter': {
129 - 'options': [None, 'Filter jitter', 'ms', 'peers', 'ntpd.peer_jitter', 'line'],
128 + 'options': [None, 'Filter jitter', 'milliseconds', 'peers', 'ntpd.peer_jitter', 'line'],
129 'lines': []
130 },
131 'peer_xleave': {
133 - 'options': [None, 'Interleave delay', 'ms', 'peers', 'ntpd.peer_xleave', 'line'],
132 + 'options': [None, 'Interleave delay', 'milliseconds', 'peers', 'ntpd.peer_xleave', 'line'],
133 'lines': []
134 },
135 'peer_rootdelay': {
137 - 'options': [None, 'Total roundtrip delay to the primary reference clock', 'ms', 'peers',
136 + 'options': [None, 'Total roundtrip delay to the primary reference clock', 'milliseconds', 'peers',
137 'ntpd.peer_rootdelay', 'line'],
138 'lines': []
139 },
@@ -234,7 +233,6 @@ class Service(SocketService):
233 SocketService.__init__(self, configuration=configuration, name=name)
234 self.order = list(ORDER)
235 self.definitions = dict(CHARTS)
237 -
236 self.port = 'ntp'
237 self.dgram_socket = True
238 self.system = System()
@@ -243,7 +241,6 @@ class Service(SocketService):
241 self.retries = 0
242 self.show_peers = self.configuration.get('show_peers', False)
243 self.peer_rescan = self.configuration.get('peer_rescan', 60)
246 -
244 if self.show_peers:
245 self.definitions.update(PEER_CHARTS)
246
collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
+6 -7
@@ -49,39 +49,39 @@ def gpu_charts(gpu):
49
50 charts = {
51 PCI_BANDWIDTH: {
52 - 'options': [None, 'PCI Express Bandwidth Utilization', 'KB/s', fam, 'nvidia_smi.pci_bandwidth', 'area'],
52 + 'options': [None, 'PCI Express Bandwidth Utilization', 'KiB/s', fam, 'nvidia_smi.pci_bandwidth', 'area'],
53 'lines': [
54 ['rx_util', 'rx', 'absolute', 1, 1],
55 ['tx_util', 'tx', 'absolute', 1, -1],
56 ]
57 },
58 FAN_SPEED: {
59 - 'options': [None, 'Fan Speed', '%', fam, 'nvidia_smi.fan_speed', 'line'],
59 + 'options': [None, 'Fan Speed', 'percentage', fam, 'nvidia_smi.fan_speed', 'line'],
60 'lines': [
61 ['fan_speed', 'speed'],
62 ]
63 },
64 GPU_UTIL: {
65 - 'options': [None, 'GPU Utilization', '%', fam, 'nvidia_smi.gpu_utilization', 'line'],
65 + 'options': [None, 'GPU Utilization', 'percentage', fam, 'nvidia_smi.gpu_utilization', 'line'],
66 'lines': [
67 ['gpu_util', 'utilization'],
68 ]
69 },
70 MEM_UTIL: {
71 - 'options': [None, 'Memory Bandwidth Utilization', '%', fam, 'nvidia_smi.mem_utilization', 'line'],
71 + 'options': [None, 'Memory Bandwidth Utilization', 'percentage', fam, 'nvidia_smi.mem_utilization', 'line'],
72 'lines': [
73 ['memory_util', 'utilization'],
74 ]
75 },
76 ENCODER_UTIL: {
77 - 'options': [None, 'Encoder/Decoder Utilization', '%', fam, 'nvidia_smi.encoder_utilization', 'line'],
77 + 'options': [None, 'Encoder/Decoder Utilization', 'percentage', fam, 'nvidia_smi.encoder_utilization', 'line'],
78 'lines': [
79 ['encoder_util', 'encoder'],
80 ['decoder_util', 'decoder'],
81 ]
82 },
83 MEM_ALLOCATED: {
84 - 'options': [None, 'Memory Allocated', 'MB', fam, 'nvidia_smi.memory_allocated', 'line'],
84 + 'options': [None, 'Memory Allocated', 'MiB', fam, 'nvidia_smi.memory_allocated', 'line'],
85 'lines': [
86 ['fb_memory_usage', 'used'],
87 ]
@@ -316,7 +316,6 @@ class Service(SimpleService):
316 super(Service, self).__init__(configuration=configuration, name=name)
317 self.order = list()
318 self.definitions = dict()
319 -
319 poll = int(configuration.get('poll_seconds', 1))
320 self.poller = NvidiaSMIPoller(poll)
321
collectors/python.d.plugin/openldap/openldap.chart.py
+1 -5
@@ -11,8 +11,6 @@ except ImportError:
11
12 from bases.FrameworkServices.SimpleService import SimpleService
13
14 -# default module values (can be overridden per job in `config`)
15 -priority = 60000
14
15 DEFAULT_SERVER = 'localhost'
16 DEFAULT_PORT = '389'
@@ -36,7 +34,7 @@ CHARTS = {
34 ]
35 },
36 'bytes_sent': {
39 - 'options': [None, 'Traffic', 'KB/s', 'ldap', 'openldap.traffic_stats', 'line'],
37 + 'options': [None, 'Traffic', 'KiB/s', 'ldap', 'openldap.traffic_stats', 'line'],
38 'lines': [
39 ['bytes_sent', 'sent', 'incremental', 1, 1024]
40 ]
@@ -136,13 +134,11 @@ class Service(SimpleService):
134 SimpleService.__init__(self, configuration=configuration, name=name)
135 self.order = ORDER
136 self.definitions = CHARTS
139 -
137 self.server = configuration.get('server', DEFAULT_SERVER)
138 self.port = configuration.get('port', DEFAULT_PORT)
139 self.username = configuration.get('username')
140 self.password = configuration.get('password')
141 self.timeout = configuration.get('timeout', DEFAULT_TIMEOUT)
145 -
142 self.alive = False
143 self.conn = None
144
collectors/python.d.plugin/ovpn_status_log/ovpn_status_log.chart.py
+16 -7
@@ -3,14 +3,18 @@
3 # Author: l2isbad
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 -from re import compile as r_compile
6 +import re
7
8 from bases.FrameworkServices.SimpleService import SimpleService
9
10 -priority = 60000
10 +
11 update_every = 10
12
13 -ORDER = ['users', 'traffic']
13 +ORDER = [
14 + 'users',
15 + 'traffic',
16 +]
17 +
18 CHARTS = {
19 'users': {
20 'options': [None, 'OpenVPN Active Users', 'active users', 'users', 'openvpn_status.users', 'line'],
@@ -19,15 +23,20 @@ CHARTS = {
23 ]
24 },
25 'traffic': {
22 - 'options': [None, 'OpenVPN Traffic', 'KB/s', 'traffic', 'openvpn_status.traffic', 'area'],
26 + 'options': [None, 'OpenVPN Traffic', 'KiB/s', 'traffic', 'openvpn_status.traffic', 'area'],
27 'lines': [
24 - ['bytes_in', 'in', 'incremental', 1, 1 << 10], ['bytes_out', 'out', 'incremental', 1, -1 << 10]
28 + ['bytes_in', 'in', 'incremental', 1, 1 << 10],
29 + ['bytes_out', 'out', 'incremental', -1, 1 << 10]
30 ]
31 }
32 }
33
29 -TLS_REGEX = r_compile(r'(?:[0-9a-f]+:[0-9a-f:]+|(?:\d{1,3}(?:\.\d{1,3}){3}(?::\d+)?)) (?P<bytes_in>\d+) (?P<bytes_out>\d+)')
30 -STATIC_KEY_REGEX = r_compile(r'TCP/[A-Z]+ (?P<direction>(?:read|write)) bytes,(?P<bytes>\d+)')
34 +TLS_REGEX = re.compile(
35 + r'(?:[0-9a-f]+:[0-9a-f:]+|(?:\d{1,3}(?:\.\d{1,3}){3}(?::\d+)?)) (?P<bytes_in>\d+) (?P<bytes_out>\d+)'
36 +)
37 +STATIC_KEY_REGEX = re.compile(
38 + r'TCP/[A-Z]+ (?P<direction>(?:read|write)) bytes,(?P<bytes>\d+)'
39 +)
40
41
42 class Service(SimpleService):
collectors/python.d.plugin/phpfpm/phpfpm.chart.py
+18 -22
@@ -9,19 +9,8 @@ import re
9
10 from bases.FrameworkServices.UrlService import UrlService
11
12 -# default module values (can be overridden per job in `config`)
13 -# update_every = 2
14 -priority = 60000
12
16 -# default job configuration (overridden by python.d.plugin)
17 -# config = {'local': {
18 -# 'update_every': update_every,
19 -# 'retries': retries,
20 -# 'priority': priority,
21 -# 'url': 'http://localhost/status?full&json'
22 -# }}
23 -
24 -# charts order (can be overridden if you want less charts, or different order)
13 +REGEX = re.compile(r'([a-z][a-z ]+): ([\d.]+)')
14
15 POOL_INFO = [
16 ('active processes', 'active'),
@@ -49,7 +38,14 @@ CALC = [
38 ('avg', average)
39 ]
40
52 -ORDER = ['connections', 'requests', 'performance', 'request_duration', 'request_cpu', 'request_mem']
41 +ORDER = [
42 + 'connections',
43 + 'requests',
44 + 'performance',
45 + 'request_duration',
46 + 'request_cpu',
47 + 'request_mem',
48 +]
49
50 CHARTS = {
51 'connections': {
@@ -84,7 +80,7 @@ CHARTS = {
80 ]
81 },
82 'request_cpu': {
87 - 'options': [None, 'PHP-FPM Request CPU', 'percent', 'request CPU', 'phpfpm.request_cpu', 'line'],
83 + 'options': [None, 'PHP-FPM Request CPU', 'percentage', 'request CPU', 'phpfpm.request_cpu', 'line'],
84 'lines': [
85 ['minReqCpu', 'min'],
86 ['maxReqCpu', 'max'],
@@ -92,7 +88,7 @@ CHARTS = {
88 ]
89 },
90 'request_mem': {
95 - 'options': [None, 'PHP-FPM Request Memory', 'kilobytes', 'request memory', 'phpfpm.request_mem', 'line'],
91 + 'options': [None, 'PHP-FPM Request Memory', 'KB', 'request memory', 'phpfpm.request_mem', 'line'],
92 'lines': [
93 ['minReqMem', 'min', 'absolute', 1, 1024],
94 ['maxReqMem', 'max', 'absolute', 1, 1024],
@@ -105,14 +101,14 @@ CHARTS = {
101 class Service(UrlService):
102 def __init__(self, configuration=None, name=None):
103 UrlService.__init__(self, configuration=configuration, name=name)
108 - self.url = self.configuration.get('url', 'http://localhost/status?full&json')
104 self.order = ORDER
105 self.definitions = CHARTS
111 - self.regex = re.compile(r'([a-z][a-z ]+): ([\d.]+)')
106 + self.url = self.configuration.get('url', 'http://localhost/status?full&json')
107 self.json = '&json' in self.url or '?json' in self.url
108 self.json_full = self.url.endswith(('?full&json', '?json&full'))
114 - self.if_all_processes_running = dict([(c_name + p_name, 0) for c_name, func in CALC
115 - for metric, p_name in PER_PROCESS_INFO])
109 + self.if_all_processes_running = dict(
110 + [(c_name + p_name, 0) for c_name, func in CALC for metric, p_name in PER_PROCESS_INFO]
111 + )
112
113 def _get_data(self):
114 """
@@ -123,7 +119,7 @@ class Service(UrlService):
119 if not raw:
120 return None
121
126 - raw_json = parse_raw_data_(is_json=self.json, regex=self.regex, raw_data=raw)
122 + raw_json = parse_raw_data_(is_json=self.json, raw_data=raw)
123
124 # Per Pool info: active connections, requests and performance charts
125 to_netdata = fetch_data_(raw_data=raw_json, metrics_list=POOL_INFO)
@@ -159,7 +155,7 @@ def fetch_data_(raw_data, metrics_list, pid=''):
155 return result
156
157
162 -def parse_raw_data_(is_json, regex, raw_data):
158 +def parse_raw_data_(is_json, raw_data):
159 """
160 :param is_json: bool
161 :param regex: compiled regular expr
@@ -173,4 +169,4 @@ def parse_raw_data_(is_json, regex, raw_data):
169 return dict()
170 else:
171 raw_data = ' '.join(raw_data.split())
176 - return dict(regex.findall(raw_data))
172 + return dict(REGEX.findall(raw_data))
collectors/python.d.plugin/portcheck/portcheck.chart.py
+1 -3
@@ -12,8 +12,6 @@ except ImportError:
12
13 from bases.FrameworkServices.SimpleService import SimpleService
14
15 -# default module values (can be overridden per job in `config`)
16 -priority = 60000
15
16 PORT_LATENCY = 'connect'
17
@@ -25,7 +23,7 @@ ORDER = ['latency', 'status']
23
24 CHARTS = {
25 'latency': {
28 - 'options': [None, 'TCP connect latency', 'ms', 'latency', 'portcheck.latency', 'line'],
26 + 'options': [None, 'TCP connect latency', 'milliseconds', 'latency', 'portcheck.latency', 'line'],
27 'lines': [
28 [PORT_LATENCY, 'connect', 'absolute', 100, 1000]
29 ]
collectors/python.d.plugin/postfix/postfix.chart.py
+7 -7
@@ -5,12 +5,12 @@
5
6 from bases.FrameworkServices.ExecutableService import ExecutableService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 2
10 -priority = 60000
8 +POSTQUEUE_COMMAND = 'postqueue -p'
9
12 -# charts order (can be overridden if you want less charts, or different order)
13 -ORDER = ['qemails', 'qsize']
10 +ORDER = [
11 + 'qemails',
12 + 'qsize',
13 +]
14
15 CHARTS = {
16 'qemails': {
@@ -20,7 +20,7 @@ CHARTS = {
20 ]
21 },
22 'qsize': {
23 - 'options': [None, 'Postfix Queue Emails Size', 'emails size in KB', 'queue', 'postfix.qsize', 'area'],
23 + 'options': [None, 'Postfix Queue Emails Size', 'KiB', 'queue', 'postfix.qsize', 'area'],
24 'lines': [
25 ['size', None, 'absolute']
26 ]
@@ -31,9 +31,9 @@ CHARTS = {
31 class Service(ExecutableService):
32 def __init__(self, configuration=None, name=None):
33 ExecutableService.__init__(self, configuration=configuration, name=name)
34 - self.command = 'postqueue -p'
34 self.order = ORDER
35 self.definitions = CHARTS
36 + self.command = POSTQUEUE_COMMAND
37
38 def _get_data(self):
39 """
collectors/python.d.plugin/postgres/postgres.chart.py
+10 -15
@@ -636,7 +636,7 @@ CHARTS = {
636 ]
637 },
638 'db_stat_temp_bytes': {
639 - 'options': [None, 'Temp files written to disk', 'KB/s', 'db statistics', 'postgres.db_stat_temp_bytes',
639 + 'options': [None, 'Temp files written to disk', 'KiB/s', 'db statistics', 'postgres.db_stat_temp_bytes',
640 'line'],
641 'lines': [
642 ['temp_bytes', 'size', 'incremental', 1, 1024]
@@ -650,7 +650,7 @@ CHARTS = {
650 ]
651 },
652 'database_size': {
653 - 'options': [None, 'Database size', 'MB', 'database size', 'postgres.db_size', 'stacked'],
653 + 'options': [None, 'Database size', 'MiB', 'database size', 'postgres.db_size', 'stacked'],
654 'lines': [
655 ]
656 },
@@ -669,7 +669,7 @@ CHARTS = {
669 ]
670 },
671 'index_size': {
672 - 'options': [None, 'Indexes size', 'MB', 'indexes', 'postgres.index_size', 'line'],
672 + 'options': [None, 'Indexes size', 'MiB', 'indexes', 'postgres.index_size', 'line'],
673 'lines': [
674 ['index_size', 'size', 'absolute', 1, 1024 * 1024]
675 ]
@@ -681,7 +681,7 @@ CHARTS = {
681 ]
682 },
683 'table_size': {
684 - 'options': [None, 'Tables size', 'MB', 'tables', 'postgres.table_size', 'line'],
684 + 'options': [None, 'Tables size', 'MiB', 'tables', 'postgres.table_size', 'line'],
685 'lines': [
686 ['table_size', 'size', 'absolute', 1, 1024 * 1024]
687 ]
@@ -695,7 +695,7 @@ CHARTS = {
695 ]
696 },
697 'wal_writes': {
698 - 'options': [None, 'Write-Ahead Logs', 'kilobytes/s', 'wal_writes', 'postgres.wal_writes', 'line'],
698 + 'options': [None, 'Write-Ahead Logs', 'KiB/s', 'wal_writes', 'postgres.wal_writes', 'line'],
699 'lines': [
700 ['wal_writes', 'writes', 'incremental', 1, 1024]
701 ]
@@ -716,20 +716,20 @@ CHARTS = {
716 ]
717 },
718 'stat_bgwriter_alloc': {
719 - 'options': [None, 'Buffers allocated', 'kilobytes/s', 'bgwriter', 'postgres.stat_bgwriter_alloc', 'line'],
719 + 'options': [None, 'Buffers allocated', 'KiB/s', 'bgwriter', 'postgres.stat_bgwriter_alloc', 'line'],
720 'lines': [
721 ['buffers_alloc', 'alloc', 'incremental', 1, 1024]
722 ]
723 },
724 'stat_bgwriter_checkpoint': {
725 - 'options': [None, 'Buffers written during checkpoints', 'kilobytes/s', 'bgwriter',
725 + 'options': [None, 'Buffers written during checkpoints', 'KiB/s', 'bgwriter',
726 'postgres.stat_bgwriter_checkpoint', 'line'],
727 'lines': [
728 ['buffers_checkpoint', 'checkpoint', 'incremental', 1, 1024]
729 ]
730 },
731 'stat_bgwriter_backend': {
732 - 'options': [None, 'Buffers written directly by a backend', 'kilobytes/s', 'bgwriter',
732 + 'options': [None, 'Buffers written directly by a backend', 'KiB/s', 'bgwriter',
733 'postgres.stat_bgwriter_backend', 'line'],
734 'lines': [
735 ['buffers_backend', 'backend', 'incremental', 1, 1024]
@@ -742,7 +742,7 @@ CHARTS = {
742 ]
743 },
744 'stat_bgwriter_bgwriter': {
745 - 'options': [None, 'Buffers written by the background writer', 'kilobytes/s', 'bgwriter',
745 + 'options': [None, 'Buffers written by the background writer', 'KiB/s', 'bgwriter',
746 'postgres.bgwriter_bgwriter', 'line'],
747 'lines': [
748 ['buffers_clean', 'clean', 'incremental', 1, 1024]
@@ -766,7 +766,7 @@ CHARTS = {
766 ]
767 },
768 'standby_delta': {
769 - 'options': [None, 'Standby delta', 'kilobytes', 'replication delta', 'postgres.standby_delta', 'line'],
769 + 'options': [None, 'Standby delta', 'KiB', 'replication delta', 'postgres.standby_delta', 'line'],
770 'lines': [
771 ['sent_delta', 'sent delta', 'absolute', 1, 1024],
772 ['write_delta', 'write delta', 'absolute', 1, 1024],
@@ -789,24 +789,19 @@ class Service(SimpleService):
789 SimpleService.__init__(self, configuration=configuration, name=name)
790 self.order = list(ORDER)
791 self.definitions = deepcopy(CHARTS)
792 -
792 self.do_table_stats = configuration.pop('table_stats', False)
793 self.do_index_stats = configuration.pop('index_stats', False)
794 self.databases_to_poll = configuration.pop('database_poll', None)
795 self.statement_timeout = configuration.pop('statement_timeout', DEFAULT_STATEMENT_TIMEOUT)
796 self.configuration = configuration
798 -
797 self.conn = None
798 self.server_version = None
799 self.is_superuser = False
800 self.alive = False
803 -
801 self.databases = list()
802 self.secondaries = list()
803 self.replication_slots = list()
807 -
804 self.queries = dict()
809 -
805 self.data = dict()
806
807 def reconnect(self):
collectors/python.d.plugin/powerdns/powerdns.chart.py
+7 -2
@@ -8,9 +8,14 @@ from json import loads
8
9 from bases.FrameworkServices.UrlService import UrlService
10
11 -priority = 60000
11
13 -ORDER = ['questions', 'cache_usage', 'cache_size', 'latency']
12 +ORDER = [
13 + 'questions',
14 + 'cache_usage',
15 + 'cache_size',
16 + 'latency',
17 +]
18 +
19 CHARTS = {
20 'questions': {
21 'options': [None, 'PowerDNS Queries and Answers', 'count', 'questions', 'powerdns.questions', 'line'],
collectors/python.d.plugin/proxysql/proxysql.chart.py
+4 -8
@@ -5,10 +5,6 @@
5
6 from bases.FrameworkServices.MySQLService import MySQLService
7
8 -# default module values (can be overridden per job in `config`)
9 -# update_every = 3
10 -priority = 60000
11 -
8
9 def query(table, *params):
10 return 'SELECT {params} FROM {table}'.format(table=table, params=', '.join(params))
@@ -132,8 +128,8 @@ CHARTS = {
128 'options': [None, 'ProxySQL Backend Overall Bandwidth', 'kilobits/s', 'overall_bandwidth',
129 'proxysql.pool_overall_net', 'area'],
130 'lines': [
135 - ['bytes_data_recv', 'in', 'incremental', 8, 1024],
136 - ['bytes_data_sent', 'out', 'incremental', -8, 1024]
131 + ['bytes_data_recv', 'in', 'incremental', 8, 1000],
132 + ['bytes_data_sent', 'out', 'incremental', -8, 1000]
133 ]
134 },
135 'questions': {
@@ -155,7 +151,7 @@ CHARTS = {
151 ]
152 },
153 'pool_latency': {
158 - 'options': [None, 'ProxySQL Backend Latency', 'ms', 'latency', 'proxysql.latency', 'line'],
154 + 'options': [None, 'ProxySQL Backend Latency', 'milliseconds', 'latency', 'proxysql.latency', 'line'],
155 'lines': []
156 },
157 'connections': {
@@ -193,7 +189,7 @@ CHARTS = {
189 'lines': []
190 },
191 'commands_duration': {
196 - 'options': [None, 'ProxySQL Commands Duration', 'ms', 'commands', 'proxysql.commands_duration', 'line'],
192 + 'options': [None, 'ProxySQL Commands Duration', 'milliseconds', 'commands', 'proxysql.commands_duration', 'line'],
193 'lines': []
194 }
195 }
collectors/python.d.plugin/puppet/puppet.chart.py
+14 -11
@@ -11,28 +11,31 @@
11 # and tls_cert_file options then.
12 #
13
14 -from bases.FrameworkServices.UrlService import UrlService
15 -from json import loads
14 import socket
15
16 +from json import loads
17 +
18 +from bases.FrameworkServices.UrlService import UrlService
19 +
20 update_every = 5
19 -priority = 60000
21
22
22 -MB = 1048576
23 +MiB = 1 << 20
24 CPU_SCALE = 1000
25 +
26 ORDER = [
27 'jvm_heap',
28 'jvm_nonheap',
29 'cpu',
30 'fd_open',
31 ]
32 +
33 CHARTS = {
34 'jvm_heap': {
32 - 'options': [None, 'JVM Heap', 'MB', 'resources', 'puppet.jvm', 'area'],
35 + 'options': [None, 'JVM Heap', 'MiB', 'resources', 'puppet.jvm', 'area'],
36 'lines': [
34 - ['jvm_heap_committed', 'committed', 'absolute', 1, MB],
35 - ['jvm_heap_used', 'used', 'absolute', 1, MB],
37 + ['jvm_heap_committed', 'committed', 'absolute', 1, MiB],
38 + ['jvm_heap_used', 'used', 'absolute', 1, MiB],
39 ],
40 'variables': [
41 ['jvm_heap_max'],
@@ -40,10 +43,10 @@ CHARTS = {
43 ],
44 },
45 'jvm_nonheap': {
43 - 'options': [None, 'JVM Non-Heap', 'MB', 'resources', 'puppet.jvm', 'area'],
46 + 'options': [None, 'JVM Non-Heap', 'MiB', 'resources', 'puppet.jvm', 'area'],
47 'lines': [
45 - ['jvm_nonheap_committed', 'committed', 'absolute', 1, MB],
46 - ['jvm_nonheap_used', 'used', 'absolute', 1, MB],
48 + ['jvm_nonheap_committed', 'committed', 'absolute', 1, MiB],
49 + ['jvm_nonheap_used', 'used', 'absolute', 1, MiB],
50 ],
51 'variables': [
52 ['jvm_nonheap_max'],
@@ -72,9 +75,9 @@ CHARTS = {
75 class Service(UrlService):
76 def __init__(self, configuration=None, name=None):
77 UrlService.__init__(self, configuration=configuration, name=name)
75 - self.url = 'https://{0}:8140'.format(socket.getfqdn())
78 self.order = ORDER
79 self.definitions = CHARTS
80 + self.url = 'https://{0}:8140'.format(socket.getfqdn())
81
82 def _get_data(self):
83 # NOTE: there are several ways to retrieve data
collectors/python.d.plugin/rabbitmq/rabbitmq.chart.py
+4 -7
@@ -14,9 +14,6 @@ except ImportError:
14
15 from bases.FrameworkServices.UrlService import UrlService
16
17 -# default module values (can be overridden per job in `config`)
18 -update_every = 1
19 -priority = 60000
17
18 METHODS = namedtuple('METHODS', ['get_data', 'url', 'stats'])
19
@@ -63,15 +60,15 @@ CHARTS = {
60 ]
61 },
62 'memory': {
66 - 'options': [None, 'Memory', 'MB', 'overview', 'rabbitmq.memory', 'area'],
63 + 'options': [None, 'Memory', 'MiB', 'overview', 'rabbitmq.memory', 'area'],
64 'lines': [
68 - ['mem_used', 'used', 'absolute', 1, 1024 << 10]
65 + ['mem_used', 'used', 'absolute', 1, 1 << 20]
66 ]
67 },
68 'disk_space': {
72 - 'options': [None, 'Disk Space', 'GB', 'overview', 'rabbitmq.disk_space', 'area'],
69 + 'options': [None, 'Disk Space', 'GiB', 'overview', 'rabbitmq.disk_space', 'area'],
70 'lines': [
74 - ['disk_free', 'free', 'absolute', 1, 1024 ** 3]
71 + ['disk_free', 'free', 'absolute', 1, 1 << 30]
72 ]
73 },
74 'socket_descriptors': {
collectors/python.d.plugin/redis/redis.chart.py
+5 -8
@@ -47,13 +47,13 @@ CHARTS = {
47 ]
48 },
49 'hit_rate': {
50 - 'options': [None, 'Hit rate', 'percent', 'hits', 'redis.hit_rate', 'line'],
50 + 'options': [None, 'Hit rate', 'percentage', 'hits', 'redis.hit_rate', 'line'],
51 'lines': [
52 ['hit_rate', 'rate', 'absolute']
53 ]
54 },
55 'memory': {
56 - 'options': [None, 'Memory utilization', 'kilobytes', 'memory', 'redis.memory', 'line'],
56 + 'options': [None, 'Memory utilization', 'KiB', 'memory', 'redis.memory', 'line'],
57 'lines': [
58 ['used_memory', 'total', 'absolute', 1, 1024],
59 ['used_memory_lua', 'lua', 'absolute', 1, 1024]
@@ -62,8 +62,8 @@ CHARTS = {
62 'net': {
63 'options': [None, 'Bandwidth', 'kilobits/s', 'network', 'redis.net', 'area'],
64 'lines': [
65 - ['total_net_input_bytes', 'in', 'incremental', 8, 1024],
66 - ['total_net_output_bytes', 'out', 'incremental', -8, 1024]
65 + ['total_net_input_bytes', 'in', 'incremental', 8, 1000],
66 + ['total_net_output_bytes', 'out', 'incremental', -8, 1000]
67 ]
68 },
69 'keys_redis': {
@@ -146,16 +146,13 @@ RE = re.compile(r'\n([a-z_0-9 ]+):(?:keys=)?([^,\r]+)')
146 class Service(SocketService):
147 def __init__(self, configuration=None, name=None):
148 SocketService.__init__(self, configuration=configuration, name=name)
149 - self._keep_alive = True
150 -
149 self.order = list()
150 self.definitions = dict()
153 -
151 + self._keep_alive = True
152 self.host = self.configuration.get('host', 'localhost')
153 self.port = self.configuration.get('port', 6379)
154 self.unix_socket = self.configuration.get('socket')
155 p = self.configuration.get('pass')
158 -
156 self.auth_request = 'AUTH {0} \r\n'.format(p).encode() if p else None
157 self.request = 'INFO\r\n'.encode()
158 self.bgsave_time = 0
collectors/python.d.plugin/rethinkdbs/rethinkdbs.chart.py
-2
@@ -136,13 +136,11 @@ class Service(SimpleService):
136 SimpleService.__init__(self, configuration=configuration, name=name)
137 self.order = list(ORDER)
138 self.definitions = cluster_charts()
139 -
139 self.host = self.configuration.get('host', '127.0.0.1')
140 self.port = self.configuration.get('port', 28015)
141 self.user = self.configuration.get('user', 'admin')
142 self.password = self.configuration.get('password')
143 self.timeout = self.configuration.get('timeout', 2)
145 -
144 self.conn = None
145 self.alive = True
146
collectors/python.d.plugin/retroshare/retroshare.chart.py
+10 -10
@@ -7,25 +7,25 @@ import json
7
8 from bases.FrameworkServices.UrlService import UrlService
9
10 -# default module values (can be overridden per job in `config`)
11 -# update_every = 2
12 -priority = 60000
10
14 -# charts order (can be overridden if you want less charts, or different order)
15 -ORDER = ['bandwidth', 'peers', 'dht']
11 +ORDER = [
12 + 'bandwidth',
13 + 'peers',
14 + 'dht',
15 +]
16
17 CHARTS = {
18 'bandwidth': {
19 - 'options': [None, 'RetroShare Bandwidth', 'kB/s', 'RetroShare', 'retroshare.bandwidth', 'area'],
19 + 'options': [None, 'RetroShare Bandwidth', 'kilobits/s', 'RetroShare', 'retroshare.bandwidth', 'area'],
20 'lines': [
21 - ['bandwidth_up_kb', 'Upload'],
21 + ['bandwidth_up_kb', 'Upload'],
22 ['bandwidth_down_kb', 'Download']
23 ]
24 },
25 'peers': {
26 'options': [None, 'RetroShare Peers', 'peers', 'RetroShare', 'retroshare.peers', 'line'],
27 'lines': [
28 - ['peers_all', 'All friends'],
28 + ['peers_all', 'All friends'],
29 ['peers_connected', 'Connected friends']
30 ]
31 },
@@ -33,7 +33,7 @@ CHARTS = {
33 'options': [None, 'Retroshare DHT', 'peers', 'RetroShare', 'retroshare.dht', 'line'],
34 'lines': [
35 ['dht_size_all', 'DHT nodes estimated'],
36 - ['dht_size_rs', 'RS nodes estimated']
36 + ['dht_size_rs', 'RS nodes estimated']
37 ]
38 }
39 }
@@ -42,9 +42,9 @@ CHARTS = {
42 class Service(UrlService):
43 def __init__(self, configuration=None, name=None):
44 UrlService.__init__(self, configuration=configuration, name=name)
45 - self.baseurl = self.configuration.get('url', 'http://localhost:9090')
45 self.order = ORDER
46 self.definitions = CHARTS
47 + self.baseurl = self.configuration.get('url', 'http://localhost:9090')
48
49 def _get_stats(self):
50 """
collectors/python.d.plugin/samba/samba.chart.py
+2 -4
@@ -24,9 +24,7 @@ from bases.FrameworkServices.ExecutableService import ExecutableService
24
25 disabled_by_default = True
26
27 -# default module values (can be overridden per job in `config`)
27 update_every = 5
29 -priority = 60000
28
29 ORDER = [
30 'syscall_rw',
@@ -40,14 +38,14 @@ ORDER = [
38
39 CHARTS = {
40 'syscall_rw': {
43 - 'options': [None, 'R/Ws', 'kilobytes/s', 'syscall', 'syscall.rw', 'area'],
41 + 'options': [None, 'R/Ws', 'KiB/s', 'syscall', 'syscall.rw', 'area'],
42 'lines': [
43 ['syscall_sendfile_bytes', 'sendfile', 'incremental', 1, 1024],
44 ['syscall_recvfile_bytes', 'recvfile', 'incremental', -1, 1024]
45 ]
46 },
47 'smb2_rw': {
50 - 'options': [None, 'R/Ws', 'kilobytes/s', 'smb2', 'smb2.rw', 'area'],
48 + 'options': [None, 'R/Ws', 'KiB/s', 'smb2', 'smb2.rw', 'area'],
49 'lines': [
50 ['smb2_read_outbytes', 'readout', 'incremental', 1, 1024],
51 ['smb2_write_inbytes', 'writein', 'incremental', -1, 1024],
collectors/python.d.plugin/sensors/sensors.chart.py
-2
@@ -7,8 +7,6 @@ from third_party import lm_sensors as sensors
7
8 from bases.FrameworkServices.SimpleService import SimpleService
9
10 -# default module values (can be overridden per job in `config`)
11 -# update_every = 2
10
11 ORDER = [
12 'temperature',
collectors/python.d.plugin/smartd_log/smartd_log.chart.py
+2 -4
@@ -268,7 +268,7 @@ CHARTS = {
268 'algo': INCREMENTAL,
269 },
270 'reserved_block_count': {
271 - 'options': [None, 'Reserved Block Count', '%', 'wear', 'smartd_log.reserved_block_count', 'line'],
271 + 'options': [None, 'Reserved Block Count', 'percentage', 'wear', 'smartd_log.reserved_block_count', 'line'],
272 'lines': [],
273 'attrs': [ATTR170],
274 'algo': ABSOLUTE,
@@ -321,7 +321,7 @@ CHARTS = {
321
322 },
323 'percent_lifetime_used': {
324 - 'options': [None, 'Percent Lifetime Used', '%', 'wear', 'smartd_log.percent_lifetime_used', 'line'],
324 + 'options': [None, 'Percent Lifetime Used', 'percentage', 'wear', 'smartd_log.percent_lifetime_used', 'line'],
325 'lines': [],
326 'attrs': [ATTR202],
327 'algo': ABSOLUTE,
@@ -586,11 +586,9 @@ class Service(SimpleService):
586 SimpleService.__init__(self, configuration=configuration, name=name)
587 self.order = ORDER
588 self.definitions = deepcopy(CHARTS)
589 -
589 self.log_path = configuration.get('log_path', DEF_PATH)
590 self.age = configuration.get('age', DEF_AGE)
591 self.exclude = configuration.get('exclude_disks', str()).split()
593 -
592 self.disks = list()
593 self.runs = 0
594
collectors/python.d.plugin/spigotmc/spigotmc.chart.py
+4 -1
@@ -16,7 +16,10 @@ update_every = 5
16
17 PRECISION = 100
18
19 -ORDER = ['tps', 'users']
19 +ORDER = [
20 + 'tps',
21 + 'users',
22 +]
23
24 CHARTS = {
25 'tps': {
collectors/python.d.plugin/springboot/springboot.chart.py
+8 -6
@@ -6,12 +6,14 @@
6 import json
7 from bases.FrameworkServices.UrlService import UrlService
8
9 -# default module values (can be overridden per job in `config`)
10 -# update_every = 2
11 -priority = 60000
9
13 -
14 -DEFAULT_ORDER = ['response_code', 'threads', 'gc_time', 'gc_ope', 'heap']
10 +DEFAULT_ORDER = [
11 + 'response_code',
12 + 'threads',
13 + 'gc_time',
14 + 'gc_ope',
15 + 'heap',
16 +]
17
18 DEFAULT_CHARTS = {
19 'response_code': {
@@ -59,7 +61,7 @@ DEFAULT_CHARTS = {
61 ]
62 },
63 'heap': {
62 - 'options': [None, "Heap Memory Usage", "KB", "heap memory", "springboot.heap", "area"],
64 + 'options': [None, "Heap Memory Usage", "KiB", "heap memory", "springboot.heap", "area"],
65 'lines': [
66 ["heap_committed", 'committed', "absolute"],
67 ["heap_used", 'used', "absolute"],
collectors/python.d.plugin/squid/squid.chart.py
+6 -6
@@ -6,12 +6,12 @@
6 from bases.FrameworkServices.SocketService import SocketService
7
8
9 -# default module values (can be overridden per job in `config`)
10 -# update_every = 2
11 -priority = 60000
12 -
13 -# charts order (can be overridden if you want less charts, or different order)
14 -ORDER = ['clients_net', 'clients_requests', 'servers_net', 'servers_requests']
9 +ORDER = [
10 + 'clients_net',
11 + 'clients_requests',
12 + 'servers_net',
13 + 'servers_requests',
14 +]
15
16 CHARTS = {
17 'clients_net': {
collectors/python.d.plugin/tomcat/tomcat.chart.py
+34 -28
@@ -8,12 +8,18 @@ import xml.etree.ElementTree as ET
8
9 from bases.FrameworkServices.UrlService import UrlService
10
11 -# default module values (can be overridden per job in `config`)
12 -# update_every = 2
13 -priority = 60000
11 +MiB = 1 << 20
12
15 -# charts order (can be overridden if you want less charts, or different order)
16 -ORDER = ['accesses', 'bandwidth', 'processing_time', 'threads', 'jvm', 'jvm_eden', 'jvm_survivor', 'jvm_tenured']
13 +ORDER = [
14 + 'accesses',
15 + 'bandwidth',
16 + 'processing_time',
17 + 'threads',
18 + 'jvm',
19 + 'jvm_eden',
20 + 'jvm_survivor',
21 + 'jvm_tenured',
22 +]
23
24 CHARTS = {
25 'accesses': {
@@ -24,7 +30,7 @@ CHARTS = {
30 ]
31 },
32 'bandwidth': {
27 - 'options': [None, 'Bandwidth', 'KB/s', 'statistics', 'tomcat.bandwidth', 'area'],
33 + 'options': [None, 'Bandwidth', 'KiB/s', 'statistics', 'tomcat.bandwidth', 'area'],
34 'lines': [
35 ['bytesSent', 'sent', 'incremental', 1, 1024],
36 ['bytesReceived', 'received', 'incremental', 1, 1024],
@@ -44,39 +50,39 @@ CHARTS = {
50 ]
51 },
52 'jvm': {
47 - 'options': [None, 'JVM Memory Pool Usage', 'MB', 'memory', 'tomcat.jvm', 'stacked'],
53 + 'options': [None, 'JVM Memory Pool Usage', 'MiB', 'memory', 'tomcat.jvm', 'stacked'],
54 'lines': [
49 - ['free', 'free', 'absolute', 1, 1048576],
50 - ['eden_used', 'eden', 'absolute', 1, 1048576],
51 - ['survivor_used', 'survivor', 'absolute', 1, 1048576],
52 - ['tenured_used', 'tenured', 'absolute', 1, 1048576],
53 - ['code_cache_used', 'code cache', 'absolute', 1, 1048576],
54 - ['compressed_used', 'compressed', 'absolute', 1, 1048576],
55 - ['metaspace_used', 'metaspace', 'absolute', 1, 1048576],
55 + ['free', 'free', 'absolute', 1, MiB],
56 + ['eden_used', 'eden', 'absolute', 1, MiB],
57 + ['survivor_used', 'survivor', 'absolute', 1, MiB],
58 + ['tenured_used', 'tenured', 'absolute', 1, MiB],
59 + ['code_cache_used', 'code cache', 'absolute', 1, MiB],
60 + ['compressed_used', 'compressed', 'absolute', 1, MiB],
61 + ['metaspace_used', 'metaspace', 'absolute', 1, MiB],
62 ]
63 },
64 'jvm_eden': {
59 - 'options': [None, 'Eden Memory Usage', 'MB', 'memory', 'tomcat.jvm_eden', 'area'],
65 + 'options': [None, 'Eden Memory Usage', 'MiB', 'memory', 'tomcat.jvm_eden', 'area'],
66 'lines': [
61 - ['eden_used', 'used', 'absolute', 1, 1048576],
62 - ['eden_committed', 'committed', 'absolute', 1, 1048576],
63 - ['eden_max', 'max', 'absolute', 1, 1048576]
67 + ['eden_used', 'used', 'absolute', 1, MiB],
68 + ['eden_committed', 'committed', 'absolute', 1, MiB],
69 + ['eden_max', 'max', 'absolute', 1, MiB]
70 ]
71 },
72 'jvm_survivor': {
67 - 'options': [None, 'Survivor Memory Usage', 'MB', 'memory', 'tomcat.jvm_survivor', 'area'],
73 + 'options': [None, 'Survivor Memory Usage', 'MiB', 'memory', 'tomcat.jvm_survivor', 'area'],
74 'lines': [
69 - ['survivor_used', 'used', 'absolute', 1, 1048576],
70 - ['survivor_committed', 'committed', 'absolute', 1, 1048576],
71 - ['survivor_max', 'max', 'absolute', 1, 1048576]
75 + ['survivor_used', 'used', 'absolute', 1, MiB],
76 + ['survivor_committed', 'committed', 'absolute', 1, MiB],
77 + ['survivor_max', 'max', 'absolute', 1, MiB],
78 ]
79 },
80 'jvm_tenured': {
75 - 'options': [None, 'Tenured Memory Usage', 'MB', 'memory', 'tomcat.jvm_tenured', 'area'],
81 + 'options': [None, 'Tenured Memory Usage', 'MiB', 'memory', 'tomcat.jvm_tenured', 'area'],
82 'lines': [
77 - ['tenured_used', 'used', 'absolute', 1, 1048576],
78 - ['tenured_committed', 'committed', 'absolute', 1, 1048576],
79 - ['tenured_max', 'max', 'absolute', 1, 1048576]
83 + ['tenured_used', 'used', 'absolute', 1, MiB],
84 + ['tenured_committed', 'committed', 'absolute', 1, MiB],
85 + ['tenured_max', 'max', 'absolute', 1, MiB]
86 ]
87 }
88 }
@@ -85,10 +91,10 @@ CHARTS = {
91 class Service(UrlService):
92 def __init__(self, configuration=None, name=None):
93 UrlService.__init__(self, configuration=configuration, name=name)
88 - self.url = self.configuration.get('url', 'http://127.0.0.1:8080/manager/status?XML=true')
89 - self.connector_name = self.configuration.get('connector_name', None)
94 self.order = ORDER
95 self.definitions = CHARTS
96 + self.url = self.configuration.get('url', 'http://127.0.0.1:8080/manager/status?XML=true')
97 + self.connector_name = self.configuration.get('connector_name', None)
98
99 def _get_data(self):
100 """
collectors/python.d.plugin/tor/tor.chart.py
+1 -3
@@ -24,7 +24,7 @@ ORDER = [
24
25 CHARTS = {
26 'traffic': {
27 - 'options': [None, 'Tor Traffic', 'KB/s', 'traffic', 'tor.traffic', 'area'],
27 + 'options': [None, 'Tor Traffic', 'KiB/s', 'traffic', 'tor.traffic', 'area'],
28 'lines': [
29 ['read', 'read', 'incremental', 1, 1024],
30 ['write', 'write', 'incremental', 1, -1024],
@@ -39,10 +39,8 @@ class Service(SimpleService):
39 super(Service, self).__init__(configuration=configuration, name=name)
40 self.order = ORDER
41 self.definitions = CHARTS
42 -
42 self.port = self.configuration.get('control_port', DEF_PORT)
43 self.password = self.configuration.get('password')
45 -
44 self.use_socket = isinstance(self.port, str) and self.port != DEF_PORT and not self.port.isdigit()
45 self.conn = None
46 self.alive = False
collectors/python.d.plugin/traefik/traefik.chart.py
+17 -11
@@ -3,15 +3,13 @@
3 # Author: Alexandre Menezes (@ale_menezes)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 -from json import loads
6 from collections import defaultdict
7 +
8 +from json import loads
9 +
10 from bases.FrameworkServices.UrlService import UrlService
11
10 -# default module values (can be overridden per job in `config`)
11 -update_every = 1
12 -priority = 60000
12
14 -# charts order (can be overridden if you want less charts, or different order)
13 ORDER = [
14 'response_statuses',
15 'response_codes',
@@ -98,14 +96,22 @@ class Service(UrlService):
96 self.url = self.configuration.get('url', 'http://localhost:8080/health')
97 self.order = ORDER
98 self.definitions = CHARTS
101 - self.data = {
102 - 'successful_requests': 0, 'redirects': 0, 'bad_requests': 0,
103 - 'server_errors': 0, 'other_requests': 0, '1xx': 0, '2xx': 0,
104 - '3xx': 0, '4xx': 0, '5xx': 0, 'other': 0,
105 - 'average_response_time_per_iteration_sec': 0
106 - }
99 self.last_total_response_time = 0
100 self.last_total_count = 0
101 + self.data = {
102 + 'successful_requests': 0,
103 + 'redirects': 0,
104 + 'bad_requests': 0,
105 + 'server_errors': 0,
106 + 'other_requests': 0,
107 + '1xx': 0,
108 + '2xx': 0,
109 + '3xx': 0,
110 + '4xx': 0,
111 + '5xx': 0,
112 + 'other': 0,
113 + 'average_response_time_per_iteration_sec': 0,
114 + }
115
116 def _get_data(self):
117 data = self._get_raw_data()
collectors/python.d.plugin/unbound/unbound.chart.py
+5 -1
@@ -13,7 +13,11 @@ from bases.loaders import YamlOrderedLoader
13
14 PRECISION = 1000
15
16 -ORDER = ['queries', 'recursion', 'reqlist']
16 +ORDER = [
17 + 'queries',
18 + 'recursion',
19 + 'reqlist',
20 +]
21
22 CHARTS = {
23 'queries': {
collectors/python.d.plugin/uwsgi/uwsgi.chart.py
+8 -13
@@ -7,9 +7,6 @@ import json
7 from copy import deepcopy
8 from bases.FrameworkServices.SocketService import SocketService
9
10 -# default module values (can be overridden per job in `config`)
11 -# update_every = 2
12 -priority = 60000
10
11 ORDER = [
12 'requests',
@@ -39,27 +36,27 @@ CHARTS = {
36 ]
37 },
38 'tx': {
42 - 'options': [None, 'Transmitted data', 'KB/s', 'requests', 'uwsgi.tx', 'stacked'],
39 + 'options': [None, 'Transmitted data', 'KiB/s', 'requests', 'uwsgi.tx', 'stacked'],
40 'lines': [
41 ['tx', 'tx', 'incremental']
42 ]
43 },
44 'avg_rt': {
48 - 'options': [None, 'Average request time', 'ms', 'requests', 'uwsgi.avg_rt', 'line'],
45 + 'options': [None, 'Average request time', 'milliseconds', 'requests', 'uwsgi.avg_rt', 'line'],
46 'lines': [
47 ['avg_rt', 'avg_rt', 'absolute']
48 ]
49 },
50 'memory_rss': {
54 - 'options': [None, 'RSS (Resident Set Size)', 'MB', 'memory', 'uwsgi.memory_rss', 'stacked'],
51 + 'options': [None, 'RSS (Resident Set Size)', 'MiB', 'memory', 'uwsgi.memory_rss', 'stacked'],
52 'lines': [
56 - ['memory_rss', 'memory_rss', 'absolute', 1, 1024 * 1024]
53 + ['memory_rss', 'memory_rss', 'absolute', 1, 1 << 20]
54 ]
55 },
56 'memory_vsz': {
60 - 'options': [None, 'VSZ (Virtual Memory Size)', 'MB', 'memory', 'uwsgi.memory_vsz', 'stacked'],
57 + 'options': [None, 'VSZ (Virtual Memory Size)', 'MiB', 'memory', 'uwsgi.memory_vsz', 'stacked'],
58 'lines': [
62 - ['memory_vsz', 'memory_vsz', 'absolute', 1, 1024 * 1024]
59 + ['memory_vsz', 'memory_vsz', 'absolute', 1, 1 << 20]
60 ]
61 },
62 'exceptions': {
@@ -86,15 +83,13 @@ CHARTS = {
83 class Service(SocketService):
84 def __init__(self, configuration=None, name=None):
85 super(Service, self).__init__(configuration=configuration, name=name)
89 - self.url = self.configuration.get('host', 'localhost')
90 - self.port = self.configuration.get('port', 1717)
86 self.order = ORDER
87 self.definitions = deepcopy(CHARTS)
93 -
88 + self.url = self.configuration.get('host', 'localhost')
89 + self.port = self.configuration.get('port', 1717)
90 # Clear dynamic dimensions, these are added during `_get_data()` to allow adding workers at run-time
91 for chart in DYNAMIC_CHARTS:
92 self.definitions[chart]['lines'] = []
97 -
93 self.last_result = {}
94 self.workers = []
95
collectors/python.d.plugin/varnish/varnish.chart.py
+3 -6
@@ -8,9 +8,6 @@ import re
8 from bases.collection import find_binary
9 from bases.FrameworkServices.ExecutableService import ExecutableService
10
11 -# default module values (can be overridden per job in `config`)
12 -# update_every = 2
13 -priority = 60000
11
12 ORDER = [
13 'session_connections',
@@ -46,7 +43,7 @@ CHARTS = {
43 ]
44 },
45 'all_time_hit_rate': {
49 - 'options': [None, 'All History Hit Rate Ratio', 'percent', 'cache performance',
46 + 'options': [None, 'All History Hit Rate Ratio', 'percentage', 'cache performance',
47 'varnish.all_time_hit_rate', 'stacked'],
48 'lines': [
49 ['cache_hit', 'hit', 'percentage-of-absolute-row'],
@@ -54,7 +51,7 @@ CHARTS = {
51 ['cache_hitpass', 'hitpass', 'percentage-of-absolute-row']]
52 },
53 'current_poll_hit_rate': {
57 - 'options': [None, 'Current Poll Hit Rate Ratio', 'percent', 'cache performance',
54 + 'options': [None, 'Current Poll Hit Rate Ratio', 'percentage', 'cache performance',
55 'varnish.current_poll_hit_rate', 'stacked'],
56 'lines': [
57 ['cache_hit', 'hit', 'percentage-of-incremental-row'],
@@ -126,7 +123,7 @@ CHARTS = {
123 ]
124 },
125 'memory_usage': {
129 - 'options': [None, 'Memory Usage', 'MB', 'memory usage', 'varnish.memory_usage', 'stacked'],
126 + 'options': [None, 'Memory Usage', 'MiB', 'memory usage', 'varnish.memory_usage', 'stacked'],
127 'lines': [
128 ['memory_free', 'free', 'absolute', 1, 1 << 20],
129 ['memory_allocated', 'allocated', 'absolute', 1, 1 << 20]]
collectors/python.d.plugin/w1sensor/w1sensor.chart.py
+3 -1
@@ -16,7 +16,9 @@ W1_DIR = '/sys/bus/w1/devices/'
16 # Lines matching the following regular expression contain a temperature value
17 RE_TEMP = re.compile(r' t=(\d+)')
18
19 -ORDER = ['temp']
19 +ORDER = [
20 + 'temp',
21 +]
22
23 CHARTS = {
24 'temp': {
collectors/python.d.plugin/web_log/web_log.chart.py
+4 -2
@@ -25,7 +25,9 @@ from bases.collection import read_last_line
25 from bases.FrameworkServices.LogService import LogService
26
27
28 -ORDER_APACHE_CACHE = ['apache_cache']
28 +ORDER_APACHE_CACHE = [
29 + 'apache_cache',
30 +]
31
32 ORDER_WEB = [
33 'response_statuses',
@@ -182,7 +184,7 @@ CHARTS_WEB = {
184
185 CHARTS_APACHE_CACHE = {
186 'apache_cache': {
185 - 'options': [None, 'Apache Cached Responses', 'percent cached', 'cached', 'web_log.apache_cache_cache',
187 + 'options': [None, 'Apache Cached Responses', 'percentage', 'cached', 'web_log.apache_cache_cache',
188 'stacked'],
189 'lines': [
190 ['hit', 'cache', 'percentage-of-absolute-row'],