@cryptotaxi247 / netdata-1 / commits / a0be1a70d

bump go.d.plugin to v0.48.0 (#14195)

Ilya Mashchenko committed Dec 31, 2022 at 20:33 UTC a0be1a70d75b1fa066b81234d8cf3c85d312a2dd
12 files changed +35 -1316
collectors/COLLECTORS.md
+7 -6
@@ -126,8 +126,8 @@ configure any of these collectors according to your setup and infrastructure.
126 - [CouchDB](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/couchdb): Monitor database health and
127 performance metrics
128 (reads/writes, HTTP traffic, replication status, etc).
129 -- [MongoDB](/collectors/python.d.plugin/mongodb/README.md): Collect memory-caching system performance metrics and
130 - reads the server's response to `stats` command (stats interface).
129 +- [MongoDB](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/mongodb): Collect server, database,
130 + replication and sharding performance and health metrics.
131 - [MySQL](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/mysql/): Collect database global,
132 replication and per user statistics.
133 - [OracleDB](/collectors/python.d.plugin/oracledb/README.md): Monitor database performance and health metrics.
@@ -135,8 +135,8 @@ configure any of these collectors according to your setup and infrastructure.
135 memory usage, queries, and more from the Redis interface-compatible database.
136 - [Postgres](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/postgres): Collect database health
137 and performance metrics.
138 -- [ProxySQL](/collectors/python.d.plugin/proxysql/README.md): Monitor database backend and frontend performance
139 - metrics.
138 +- [ProxySQL](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/proxysql): Monitor database backend
139 + and frontend performance metrics.
140 - [Redis](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/redis/): Monitor status from any
141 number of database instances by reading the server's response to the `INFO ALL` command.
142 - [RethinkDB](/collectors/python.d.plugin/rethinkdbs/README.md): Collect database server and cluster statistics.
@@ -231,8 +231,9 @@ configure any of these collectors according to your setup and infrastructure.
231 (`slapd`) server.
232 - [NSD](/collectors/python.d.plugin/nsd/README.md): Monitor nameserver performance metrics using the `nsd-control`
233 tool.
234 -- [NTP daemon](/collectors/python.d.plugin/ntpd/README.md): Monitor the system variables of the local `ntpd` daemon
235 - (optionally including variables of the polled peers) using the NTP Control Message Protocol via a UDP socket.
234 +- [NTP daemon](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/ntpd): Monitor the system variables
235 + of the local `ntpd` daemon (optionally including variables of the polled peers) using the NTP Control Message Protocol
236 + via a UDP socket.
237 - [OpenSIPS](/collectors/charts.d.plugin/opensips/README.md): Collect server health and performance metrics using the
238 `opensipsctl` tool.
239 - [OpenVPN](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/openvpn/): Gather server summary
collectors/python.d.plugin/Makefile.am
-1
@@ -62,7 +62,6 @@ include ipfs/Makefile.inc
62 include litespeed/Makefile.inc
63 include megacli/Makefile.inc
64 include memcached/Makefile.inc
65 -include mongodb/Makefile.inc
65 include monit/Makefile.inc
66 include nvidia_smi/Makefile.inc
67 include nsd/Makefile.inc
collectors/python.d.plugin/mongodb/Makefile.inc deleted
-13
@@ -1,13 +0,0 @@
1 -# SPDX-License-Identifier: GPL-3.0-or-later
2 -
3 -# THIS IS NOT A COMPLETE Makefile
4 -# IT IS INCLUDED BY ITS PARENT'S Makefile.am
5 -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
6 -
7 -# install these files
8 -dist_python_DATA += mongodb/mongodb.chart.py
9 -dist_pythonconfig_DATA += mongodb/mongodb.conf
10 -
11 -# do not install these files, but include them in the distribution
12 -dist_noinst_DATA += mongodb/README.md mongodb/Makefile.inc
13 -
collectors/python.d.plugin/mongodb/README.md deleted
-210
@@ -1,210 +0,0 @@
1 -<!--
2 -title: "MongoDB monitoring with Netdata"
3 -custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/python.d.plugin/mongodb/README.md
4 -sidebar_label: "MongoDB"
5 --->
6 -
7 -# MongoDB monitoring with Netdata
8 -
9 -Monitors performance and health metrics of MongoDB.
10 -
11 -## Requirements
12 -
13 -- `python-pymongo` package v2.4+.
14 -
15 -You need to install it manually.
16 -
17 -Number of charts depends on mongodb version, storage engine and other features (replication):
18 -
19 -1. **Read requests**:
20 -
21 - - query
22 - - getmore (operation the cursor executes to get additional data from query)
23 -
24 -2. **Write requests**:
25 -
26 - - insert
27 - - delete
28 - - update
29 -
30 -3. **Active clients**:
31 -
32 - - readers (number of clients with read operations in progress or queued)
33 - - writers (number of clients with write operations in progress or queued)
34 -
35 -4. **Journal transactions**:
36 -
37 - - commits (count of transactions that have been written to the journal)
38 -
39 -5. **Data written to the journal**:
40 -
41 - - volume (volume of data)
42 -
43 -6. **Background flush** (MMAPv1):
44 -
45 - - average ms (average time taken by flushes to execute)
46 - - last ms (time taken by the last flush)
47 -
48 -7. **Read tickets** (WiredTiger):
49 -
50 - - in use (number of read tickets in use)
51 - - available (number of available read tickets remaining)
52 -
53 -8. **Write tickets** (WiredTiger):
54 -
55 - - in use (number of write tickets in use)
56 - - available (number of available write tickets remaining)
57 -
58 -9. **Cursors**:
59 -
60 -- opened (number of cursors currently opened by MongoDB for clients)
61 -- timedOut (number of cursors that have timed)
62 -- noTimeout (number of open cursors with timeout disabled)
63 -
64 -10. **Connections**:
65 -
66 - - connected (number of clients currently connected to the database server)
67 - - unused (number of unused connections available for new clients)
68 -
69 -11. **Memory usage metrics**:
70 -
71 - - virtual
72 - - resident (amount of memory used by the database process)
73 - - mapped
74 - - non mapped
75 -
76 -12. **Page faults**:
77 -
78 - - page faults (number of times MongoDB had to request from disk)
79 -
80 -13. **Cache metrics** (WiredTiger):
81 -
82 - - percentage of bytes currently in the cache (amount of space taken by cached data)
83 - - percentage of tracked dirty bytes in the cache (amount of space taken by dirty data)
84 -
85 -14. **Pages evicted from cache** (WiredTiger):
86 -
87 - - modified
88 - - unmodified
89 -
90 -15. **Queued requests**:
91 -
92 - - readers (number of read request currently queued)
93 - - writers (number of write request currently queued)
94 -
95 -16. **Errors**:
96 -
97 - - msg (number of message assertions raised)
98 - - warning (number of warning assertions raised)
99 - - regular (number of regular assertions raised)
100 - - user (number of assertions corresponding to errors generated by users)
101 -
102 -17. **Storage metrics** (one chart for every database)
103 -
104 - - dataSize (size of all documents + padding in the database)
105 - - indexSize (size of all indexes in the database)
106 - - storageSize (size of all extents in the database)
107 -
108 -18. **Documents in the database** (one chart for all databases)
109 -
110 -- documents (number of objects in the database among all the collections)
111 -
112 -19. **tcmalloc metrics**
113 -
114 - - central cache free
115 - - current total thread cache
116 - - pageheap free
117 - - pageheap unmapped
118 - - thread cache free
119 - - transfer cache free
120 - - heap size
121 -
122 -20. **Commands total/failed rate**
123 -
124 - - count
125 - - createIndex
126 - - delete
127 - - eval
128 - - findAndModify
129 - - insert
130 -
131 -21. **Locks metrics** (acquireCount metrics - number of times the lock was acquired in the specified mode)
132 -
133 - - Global lock
134 - - Database lock
135 - - Collection lock
136 - - Metadata lock
137 - - oplog lock
138 -
139 -22. **Replica set members state**
140 -
141 - - state
142 -
143 -23. **Oplog window**
144 -
145 - - window (interval of time between the oldest and the latest entries in the oplog)
146 -
147 -24. **Replication lag**
148 -
149 - - member (time when last entry from the oplog was applied for every member)
150 -
151 -25. **Replication set member heartbeat latency**
152 -
153 - - member (time when last heartbeat was received from replica set member)
154 -
155 -## Prerequisite
156 -
157 -Create a read-only user for Netdata in the admin database.
158 -
159 -1. Authenticate as the admin user.
160 -
161 -```
162 -use admin
163 -db.auth("admin", "<MONGODB_ADMIN_PASSWORD>")
164 -```
165 -
166 -2. Create a user.
167 -
168 -```
169 -# MongoDB 2.x.
170 -db.addUser("netdata", "<UNIQUE_PASSWORD>", true)
171 -
172 -# MongoDB 3.x or higher.
173 -db.createUser({
174 - "user":"netdata",
175 - "pwd": "<UNIQUE_PASSWORD>",
176 - "roles" : [
177 - {role: 'read', db: 'admin' },
178 - {role: 'clusterMonitor', db: 'admin'},
179 - {role: 'read', db: 'local' }
180 - ]
181 -})
182 -```
183 -
184 -## Configuration
185 -
186 -Edit the `python.d/mongodb.conf` configuration file using `edit-config` from the Netdata [config
187 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
188 -
189 -```bash
190 -cd /etc/netdata # Replace this path with your Netdata config directory, if different
191 -sudo ./edit-config python.d/mongodb.conf
192 -```
193 -
194 -Sample:
195 -
196 -```yaml
197 -local:
198 - name : 'local'
199 - authdb: 'admin'
200 - host : '127.0.0.1'
201 - port : 27017
202 - user : 'netdata'
203 - pass : 'netdata'
204 -```
205 -
206 -If no configuration is given, module will attempt to connect to mongodb daemon on `127.0.0.1:27017` address
207 -
208 ----
209 -
210 -
collectors/python.d.plugin/mongodb/mongodb.chart.py deleted
-786
@@ -1,786 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: mongodb netdata python.d module
3 -# Author: ilyam8
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -import ssl
7 -
8 -from copy import deepcopy
9 -from datetime import datetime
10 -from sys import exc_info
11 -
12 -try:
13 - from pymongo import MongoClient, ASCENDING, DESCENDING, version_tuple
14 - from pymongo.errors import PyMongoError
15 -
16 - PYMONGO = True
17 -except ImportError:
18 - PYMONGO = False
19 -
20 -from bases.FrameworkServices.SimpleService import SimpleService
21 -
22 -REPL_SET_STATES = [
23 - ('1', 'primary'),
24 - ('8', 'down'),
25 - ('2', 'secondary'),
26 - ('3', 'recovering'),
27 - ('5', 'startup2'),
28 - ('4', 'fatal'),
29 - ('7', 'arbiter'),
30 - ('6', 'unknown'),
31 - ('9', 'rollback'),
32 - ('10', 'removed'),
33 - ('0', 'startup')
34 -]
35 -
36 -
37 -def multiply_by_100(value):
38 - return value * 100
39 -
40 -
41 -DEFAULT_METRICS = [
42 - ('opcounters.delete', None, None),
43 - ('opcounters.update', None, None),
44 - ('opcounters.insert', None, None),
45 - ('opcounters.query', None, None),
46 - ('opcounters.getmore', None, None),
47 - ('globalLock.activeClients.readers', 'activeClients_readers', None),
48 - ('globalLock.activeClients.writers', 'activeClients_writers', None),
49 - ('connections.available', 'connections_available', None),
50 - ('connections.current', 'connections_current', None),
51 - ('mem.mapped', None, None),
52 - ('mem.resident', None, None),
53 - ('mem.virtual', None, None),
54 - ('globalLock.currentQueue.readers', 'currentQueue_readers', None),
55 - ('globalLock.currentQueue.writers', 'currentQueue_writers', None),
56 - ('asserts.msg', None, None),
57 - ('asserts.regular', None, None),
58 - ('asserts.user', None, None),
59 - ('asserts.warning', None, None),
60 - ('extra_info.page_faults', None, None),
61 - ('metrics.record.moves', None, None),
62 - ('backgroundFlushing.average_ms', None, multiply_by_100),
63 - ('backgroundFlushing.last_ms', None, multiply_by_100),
64 - ('backgroundFlushing.flushes', None, multiply_by_100),
65 - ('metrics.cursor.timedOut', None, None),
66 - ('metrics.cursor.open.total', 'cursor_total', None),
67 - ('metrics.cursor.open.noTimeout', None, None),
68 - ('cursors.timedOut', None, None),
69 - ('cursors.totalOpen', 'cursor_total', None)
70 -]
71 -
72 -DUR = [
73 - ('dur.commits', None, None),
74 - ('dur.journaledMB', None, multiply_by_100)
75 -]
76 -
77 -WIREDTIGER = [
78 - ('wiredTiger.concurrentTransactions.read.available', 'wiredTigerRead_available', None),
79 - ('wiredTiger.concurrentTransactions.read.out', 'wiredTigerRead_out', None),
80 - ('wiredTiger.concurrentTransactions.write.available', 'wiredTigerWrite_available', None),
81 - ('wiredTiger.concurrentTransactions.write.out', 'wiredTigerWrite_out', None),
82 - ('wiredTiger.cache.bytes currently in the cache', None, None),
83 - ('wiredTiger.cache.tracked dirty bytes in the cache', None, None),
84 - ('wiredTiger.cache.maximum bytes configured', None, None),
85 - ('wiredTiger.cache.unmodified pages evicted', 'unmodified', None),
86 - ('wiredTiger.cache.modified pages evicted', 'modified', None)
87 -]
88 -
89 -TCMALLOC = [
90 - ('tcmalloc.generic.current_allocated_bytes', None, None),
91 - ('tcmalloc.generic.heap_size', None, None),
92 - ('tcmalloc.tcmalloc.central_cache_free_bytes', None, None),
93 - ('tcmalloc.tcmalloc.current_total_thread_cache_bytes', None, None),
94 - ('tcmalloc.tcmalloc.pageheap_free_bytes', None, None),
95 - ('tcmalloc.tcmalloc.pageheap_unmapped_bytes', None, None),
96 - ('tcmalloc.tcmalloc.thread_cache_free_bytes', None, None),
97 - ('tcmalloc.tcmalloc.transfer_cache_free_bytes', None, None)
98 -]
99 -
100 -COMMANDS = [
101 - ('metrics.commands.count.total', 'count_total', None),
102 - ('metrics.commands.createIndexes.total', 'createIndexes_total', None),
103 - ('metrics.commands.delete.total', 'delete_total', None),
104 - ('metrics.commands.eval.total', 'eval_total', None),
105 - ('metrics.commands.findAndModify.total', 'findAndModify_total', None),
106 - ('metrics.commands.insert.total', 'insert_total', None),
107 - ('metrics.commands.delete.total', 'delete_total', None),
108 - ('metrics.commands.count.failed', 'count_failed', None),
109 - ('metrics.commands.createIndexes.failed', 'createIndexes_failed', None),
110 - ('metrics.commands.delete.failed', 'delete_failed', None),
111 - ('metrics.commands.eval.failed', 'eval_failed', None),
112 - ('metrics.commands.findAndModify.failed', 'findAndModify_failed', None),
113 - ('metrics.commands.insert.failed', 'insert_failed', None),
114 - ('metrics.commands.delete.failed', 'delete_failed', None)
115 -]
116 -
117 -LOCKS = [
118 - ('locks.Collection.acquireCount.R', 'Collection_R', None),
119 - ('locks.Collection.acquireCount.r', 'Collection_r', None),
120 - ('locks.Collection.acquireCount.W', 'Collection_W', None),
121 - ('locks.Collection.acquireCount.w', 'Collection_w', None),
122 - ('locks.Database.acquireCount.R', 'Database_R', None),
123 - ('locks.Database.acquireCount.r', 'Database_r', None),
124 - ('locks.Database.acquireCount.W', 'Database_W', None),
125 - ('locks.Database.acquireCount.w', 'Database_w', None),
126 - ('locks.Global.acquireCount.R', 'Global_R', None),
127 - ('locks.Global.acquireCount.r', 'Global_r', None),
128 - ('locks.Global.acquireCount.W', 'Global_W', None),
129 - ('locks.Global.acquireCount.w', 'Global_w', None),
130 - ('locks.Metadata.acquireCount.R', 'Metadata_R', None),
131 - ('locks.Metadata.acquireCount.w', 'Metadata_w', None),
132 - ('locks.oplog.acquireCount.r', 'oplog_r', None),
133 - ('locks.oplog.acquireCount.w', 'oplog_w', None)
134 -]
135 -
136 -DBSTATS = [
137 - 'dataSize',
138 - 'indexSize',
139 - 'storageSize',
140 - 'objects'
141 -]
142 -
143 -# charts order (can be overridden if you want less charts, or different order)
144 -ORDER = [
145 - 'read_operations',
146 - 'write_operations',
147 - 'active_clients',
148 - 'journaling_transactions',
149 - 'journaling_volume',
150 - 'background_flush_average',
151 - 'background_flush_last',
152 - 'background_flush_rate',
153 - 'wiredtiger_read',
154 - 'wiredtiger_write',
155 - 'cursors',
156 - 'connections',
157 - 'memory',
158 - 'page_faults',
159 - 'queued_requests',
160 - 'record_moves',
161 - 'wiredtiger_cache',
162 - 'wiredtiger_pages_evicted',
163 - 'asserts',
164 - 'locks_collection',
165 - 'locks_database',
166 - 'locks_global',
167 - 'locks_metadata',
168 - 'locks_oplog',
169 - 'dbstats_objects',
170 - 'tcmalloc_generic',
171 - 'tcmalloc_metrics',
172 - 'command_total_rate',
173 - 'command_failed_rate'
174 -]
175 -
176 -CHARTS = {
177 - 'read_operations': {
178 - 'options': [None, 'Received read requests', 'requests/s', 'throughput metrics',
179 - 'mongodb.read_operations', 'line'],
180 - 'lines': [
181 - ['query', None, 'incremental'],
182 - ['getmore', None, 'incremental']
183 - ]
184 - },
185 - 'write_operations': {
186 - 'options': [None, 'Received write requests', 'requests/s', 'throughput metrics',
187 - 'mongodb.write_operations', 'line'],
188 - 'lines': [
189 - ['insert', None, 'incremental'],
190 - ['update', None, 'incremental'],
191 - ['delete', None, 'incremental']
192 - ]
193 - },
194 - 'active_clients': {
195 - 'options': [None, 'Clients with read or write operations in progress or queued', 'clients',
196 - 'throughput metrics', 'mongodb.active_clients', 'line'],
197 - 'lines': [
198 - ['activeClients_readers', 'readers', 'absolute'],
199 - ['activeClients_writers', 'writers', 'absolute']
200 - ]
201 - },
202 - 'journaling_transactions': {
203 - 'options': [None, 'Transactions that have been written to the journal', 'commits',
204 - 'database performance', 'mongodb.journaling_transactions', 'line'],
205 - 'lines': [
206 - ['commits', None, 'absolute']
207 - ]
208 - },
209 - 'journaling_volume': {
210 - 'options': [None, 'Volume of data written to the journal', 'MiB', 'database performance',
211 - 'mongodb.journaling_volume', 'line'],
212 - 'lines': [
213 - ['journaledMB', 'volume', 'absolute', 1, 100]
214 - ]
215 - },
216 - 'background_flush_average': {
217 - 'options': [None, 'Average time taken by flushes to execute', 'milliseconds', 'database performance',
218 - 'mongodb.background_flush_average', 'line'],
219 - 'lines': [
220 - ['average_ms', 'time', 'absolute', 1, 100]
221 - ]
222 - },
223 - 'background_flush_last': {
224 - 'options': [None, 'Time taken by the last flush operation to execute', 'milliseconds', 'database performance',
225 - 'mongodb.background_flush_last', 'line'],
226 - 'lines': [
227 - ['last_ms', 'time', 'absolute', 1, 100]
228 - ]
229 - },
230 - 'background_flush_rate': {
231 - 'options': [None, 'Flushes rate', 'flushes', 'database performance', 'mongodb.background_flush_rate', 'line'],
232 - 'lines': [
233 - ['flushes', 'flushes', 'incremental', 1, 1]
234 - ]
235 - },
236 - 'wiredtiger_read': {
237 - 'options': [None, 'Read tickets in use and remaining', 'tickets', 'database performance',
238 - 'mongodb.wiredtiger_read', 'stacked'],
239 - 'lines': [
240 - ['wiredTigerRead_available', 'available', 'absolute', 1, 1],
241 - ['wiredTigerRead_out', 'inuse', 'absolute', 1, 1]
242 - ]
243 - },
244 - 'wiredtiger_write': {
245 - 'options': [None, 'Write tickets in use and remaining', 'tickets', 'database performance',
246 - 'mongodb.wiredtiger_write', 'stacked'],
247 - 'lines': [
248 - ['wiredTigerWrite_available', 'available', 'absolute', 1, 1],
249 - ['wiredTigerWrite_out', 'inuse', 'absolute', 1, 1]
250 - ]
251 - },
252 - 'cursors': {
253 - 'options': [None, 'Currently opened cursors, cursors with timeout disabled and timed out cursors',
254 - 'cursors', 'database performance', 'mongodb.cursors', 'stacked'],
255 - 'lines': [
256 - ['cursor_total', 'opened', 'absolute', 1, 1],
257 - ['noTimeout', None, 'absolute', 1, 1],
258 - ['timedOut', None, 'incremental', 1, 1]
259 - ]
260 - },
261 - 'connections': {
262 - 'options': [None, 'Currently connected clients and unused connections', 'connections',
263 - 'resource utilization', 'mongodb.connections', 'stacked'],
264 - 'lines': [
265 - ['connections_available', 'unused', 'absolute', 1, 1],
266 - ['connections_current', 'connected', 'absolute', 1, 1]
267 - ]
268 - },
269 - 'memory': {
270 - 'options': [None, 'Memory metrics', 'MiB', 'resource utilization', 'mongodb.memory', 'stacked'],
271 - 'lines': [
272 - ['virtual', None, 'absolute', 1, 1],
273 - ['resident', None, 'absolute', 1, 1],
274 - ['nonmapped', None, 'absolute', 1, 1],
275 - ['mapped', None, 'absolute', 1, 1]
276 - ]
277 - },
278 - 'page_faults': {
279 - 'options': [None, 'Number of times MongoDB had to fetch data from disk', 'request/s',
280 - 'resource utilization', 'mongodb.page_faults', 'line'],
281 - 'lines': [
282 - ['page_faults', None, 'incremental', 1, 1]
283 - ]
284 - },
285 - 'queued_requests': {
286 - 'options': [None, 'Currently queued read and write requests', 'requests', 'resource saturation',
287 - 'mongodb.queued_requests', 'line'],
288 - 'lines': [
289 - ['currentQueue_readers', 'readers', 'absolute', 1, 1],
290 - ['currentQueue_writers', 'writers', 'absolute', 1, 1]
291 - ]
292 - },
293 - 'record_moves': {
294 - 'options': [None, 'Number of times documents had to be moved on-disk', 'number',
295 - 'resource saturation', 'mongodb.record_moves', 'line'],
296 - 'lines': [
297 - ['moves', None, 'incremental', 1, 1]
298 - ]
299 - },
300 - 'asserts': {
301 - 'options': [
302 - None,
303 - 'Number of message, warning, regular, corresponding to errors generated by users assertions raised',
304 - 'number', 'errors (asserts)', 'mongodb.asserts', 'line'],
305 - 'lines': [
306 - ['msg', None, 'incremental', 1, 1],
307 - ['warning', None, 'incremental', 1, 1],
308 - ['regular', None, 'incremental', 1, 1],
309 - ['user', None, 'incremental', 1, 1]
310 - ]
311 - },
312 - 'wiredtiger_cache': {
313 - 'options': [None, 'The percentage of the wiredTiger cache that is in use and cache with dirty bytes',
314 - 'percentage', 'resource utilization', 'mongodb.wiredtiger_cache', 'stacked'],
315 - 'lines': [
316 - ['wiredTiger_percent_clean', 'inuse', 'absolute', 1, 1000],
317 - ['wiredTiger_percent_dirty', 'dirty', 'absolute', 1, 1000]
318 - ]
319 - },
320 - 'wiredtiger_pages_evicted': {
321 - 'options': [None, 'Pages evicted from the cache',
322 - 'pages', 'resource utilization', 'mongodb.wiredtiger_pages_evicted', 'stacked'],
323 - 'lines': [
324 - ['unmodified', None, 'absolute', 1, 1],
325 - ['modified', None, 'absolute', 1, 1]
326 - ]
327 - },
328 - 'dbstats_objects': {
329 - 'options': [None, 'Number of documents in the database among all the collections', 'documents',
330 - 'storage size metrics', 'mongodb.dbstats_objects', 'stacked'],
331 - 'lines': []
332 - },
333 - 'tcmalloc_generic': {
334 - 'options': [None, 'Tcmalloc generic metrics', 'MiB', 'tcmalloc', 'mongodb.tcmalloc_generic', 'stacked'],
335 - 'lines': [
336 - ['current_allocated_bytes', 'allocated', 'absolute', 1, 1 << 20],
337 - ['heap_size', 'heap_size', 'absolute', 1, 1 << 20]
338 - ]
339 - },
340 - 'tcmalloc_metrics': {
341 - 'options': [None, 'Tcmalloc metrics', 'KiB', 'tcmalloc', 'mongodb.tcmalloc_metrics', 'stacked'],
342 - 'lines': [
343 - ['central_cache_free_bytes', 'central_cache_free', 'absolute', 1, 1024],
344 - ['current_total_thread_cache_bytes', 'current_total_thread_cache', 'absolute', 1, 1024],
345 - ['pageheap_free_bytes', 'pageheap_free', 'absolute', 1, 1024],
346 - ['pageheap_unmapped_bytes', 'pageheap_unmapped', 'absolute', 1, 1024],
347 - ['thread_cache_free_bytes', 'thread_cache_free', 'absolute', 1, 1024],
348 - ['transfer_cache_free_bytes', 'transfer_cache_free', 'absolute', 1, 1024]
349 - ]
350 - },
351 - 'command_total_rate': {
352 - 'options': [None, 'Commands total rate', 'commands/s', 'commands', 'mongodb.command_total_rate', 'stacked'],
353 - 'lines': [
354 - ['count_total', 'count', 'incremental', 1, 1],
355 - ['createIndexes_total', 'createIndexes', 'incremental', 1, 1],
356 - ['delete_total', 'delete', 'incremental', 1, 1],
357 - ['eval_total', 'eval', 'incremental', 1, 1],
358 - ['findAndModify_total', 'findAndModify', 'incremental', 1, 1],
359 - ['insert_total', 'insert', 'incremental', 1, 1],
360 - ['update_total', 'update', 'incremental', 1, 1]
361 - ]
362 - },
363 - 'command_failed_rate': {
364 - 'options': [None, 'Commands failed rate', 'commands/s', 'commands', 'mongodb.command_failed_rate', 'stacked'],
365 - 'lines': [
366 - ['count_failed', 'count', 'incremental', 1, 1],
367 - ['createIndexes_failed', 'createIndexes', 'incremental', 1, 1],
368 - ['delete_failed', 'delete', 'incremental', 1, 1],
369 - ['eval_failed', 'eval', 'incremental', 1, 1],
370 - ['findAndModify_failed', 'findAndModify', 'incremental', 1, 1],
371 - ['insert_failed', 'insert', 'incremental', 1, 1],
372 - ['update_failed', 'update', 'incremental', 1, 1]
373 - ]
374 - },
375 - 'locks_collection': {
376 - 'options': [None, 'Collection lock. Number of times the lock was acquired in the specified mode',
377 - 'locks', 'locks metrics', 'mongodb.locks_collection', 'stacked'],
378 - 'lines': [
379 - ['Collection_R', 'shared', 'incremental'],
380 - ['Collection_W', 'exclusive', 'incremental'],
381 - ['Collection_r', 'intent_shared', 'incremental'],
382 - ['Collection_w', 'intent_exclusive', 'incremental']
383 - ]
384 - },
385 - 'locks_database': {
386 - 'options': [None, 'Database lock. Number of times the lock was acquired in the specified mode',
387 - 'locks', 'locks metrics', 'mongodb.locks_database', 'stacked'],
388 - 'lines': [
389 - ['Database_R', 'shared', 'incremental'],
390 - ['Database_W', 'exclusive', 'incremental'],
391 - ['Database_r', 'intent_shared', 'incremental'],
392 - ['Database_w', 'intent_exclusive', 'incremental']
393 - ]
394 - },
395 - 'locks_global': {
396 - 'options': [None, 'Global lock. Number of times the lock was acquired in the specified mode',
397 - 'locks', 'locks metrics', 'mongodb.locks_global', 'stacked'],
398 - 'lines': [
399 - ['Global_R', 'shared', 'incremental'],
400 - ['Global_W', 'exclusive', 'incremental'],
401 - ['Global_r', 'intent_shared', 'incremental'],
402 - ['Global_w', 'intent_exclusive', 'incremental']
403 - ]
404 - },
405 - 'locks_metadata': {
406 - 'options': [None, 'Metadata lock. Number of times the lock was acquired in the specified mode',
407 - 'locks', 'locks metrics', 'mongodb.locks_metadata', 'stacked'],
408 - 'lines': [
409 - ['Metadata_R', 'shared', 'incremental'],
410 - ['Metadata_w', 'intent_exclusive', 'incremental']
411 - ]
412 - },
413 - 'locks_oplog': {
414 - 'options': [None, 'Lock on the oplog. Number of times the lock was acquired in the specified mode',
415 - 'locks', 'locks metrics', 'mongodb.locks_oplog', 'stacked'],
416 - 'lines': [
417 - ['oplog_r', 'intent_shared', 'incremental'],
418 - ['oplog_w', 'intent_exclusive', 'incremental']
419 - ]
420 - }
421 -}
422 -
423 -DEFAULT_HOST = '127.0.0.1'
424 -DEFAULT_PORT = 27017
425 -DEFAULT_TIMEOUT = 100
426 -DEFAULT_AUTHDB = 'admin'
427 -
428 -CONN_PARAM_HOST = 'host'
429 -CONN_PARAM_PORT = 'port'
430 -CONN_PARAM_SERVER_SELECTION_TIMEOUT_MS = 'serverselectiontimeoutms'
431 -CONN_PARAM_SSL_SSL = 'ssl'
432 -CONN_PARAM_SSL_CERT_REQS = 'ssl_cert_reqs'
433 -CONN_PARAM_SSL_CA_CERTS = 'ssl_ca_certs'
434 -CONN_PARAM_SSL_CRL_FILE = 'ssl_crlfile'
435 -CONN_PARAM_SSL_CERT_FILE = 'ssl_certfile'
436 -CONN_PARAM_SSL_KEY_FILE = 'ssl_keyfile'
437 -CONN_PARAM_SSL_PEM_PASSPHRASE = 'ssl_pem_passphrase'
438 -
439 -
440 -class Service(SimpleService):
441 - def __init__(self, configuration=None, name=None):
442 - SimpleService.__init__(self, configuration=configuration, name=name)
443 - self.order = ORDER[:]
444 - self.definitions = deepcopy(CHARTS)
445 - self.authdb = self.configuration.get('authdb', DEFAULT_AUTHDB)
446 - self.user = self.configuration.get('user')
447 - self.password = self.configuration.get('pass')
448 - self.metrics_to_collect = deepcopy(DEFAULT_METRICS)
449 - self.connection = None
450 - self.do_replica = None
451 - self.databases = list()
452 -
453 - def check(self):
454 - if not PYMONGO:
455 - self.error('Pymongo package v2.4+ is needed to use mongodb.chart.py')
456 - return False
457 - self.connection, server_status, error = self._create_connection()
458 - if error:
459 - self.error(error)
460 - return False
461 -
462 - self.build_metrics_to_collect_(server_status)
463 -
464 - try:
465 - data = self._get_data()
466 - except (LookupError, SyntaxError, AttributeError):
467 - self.error('Type: %s, error: %s' % (str(exc_info()[0]), str(exc_info()[1])))
468 - return False
469 - if isinstance(data, dict) and data:
470 - self._data_from_check = data
471 - self.create_charts_(server_status)
472 - return True
473 - self.error('_get_data() returned no data or type is not <dict>')
474 - return False
475 -
476 - def build_metrics_to_collect_(self, server_status):
477 -
478 - self.do_replica = 'repl' in server_status
479 - if 'dur' in server_status:
480 - self.metrics_to_collect.extend(DUR)
481 - if 'tcmalloc' in server_status:
482 - self.metrics_to_collect.extend(TCMALLOC)
483 - if 'commands' in server_status['metrics']:
484 - self.metrics_to_collect.extend(COMMANDS)
485 - if 'wiredTiger' in server_status:
486 - self.metrics_to_collect.extend(WIREDTIGER)
487 - has_locks = 'locks' in server_status
488 - if has_locks and 'Collection' in server_status['locks']:
489 - self.metrics_to_collect.extend(LOCKS)
490 -
491 - def create_charts_(self, server_status):
492 -
493 - if 'dur' not in server_status:
494 - self.order.remove('journaling_transactions')
495 - self.order.remove('journaling_volume')
496 -
497 - if 'backgroundFlushing' not in server_status:
498 - self.order.remove('background_flush_average')
499 - self.order.remove('background_flush_last')
500 - self.order.remove('background_flush_rate')
501 -
502 - if 'wiredTiger' not in server_status:
503 - self.order.remove('wiredtiger_write')
504 - self.order.remove('wiredtiger_read')
505 - self.order.remove('wiredtiger_cache')
506 -
507 - if 'tcmalloc' not in server_status:
508 - self.order.remove('tcmalloc_generic')
509 - self.order.remove('tcmalloc_metrics')
510 -
511 - if 'commands' not in server_status['metrics']:
512 - self.order.remove('command_total_rate')
513 - self.order.remove('command_failed_rate')
514 -
515 - has_no_locks = 'locks' not in server_status
516 - if has_no_locks or 'Collection' not in server_status['locks']:
517 - self.order.remove('locks_collection')
518 - self.order.remove('locks_database')
519 - self.order.remove('locks_global')
520 - self.order.remove('locks_metadata')
521 -
522 - if has_no_locks or 'oplog' not in server_status['locks']:
523 - self.order.remove('locks_oplog')
524 -
525 - for dbase in self.databases:
526 - self.order.append('_'.join([dbase, 'dbstats']))
527 - self.definitions['_'.join([dbase, 'dbstats'])] = {
528 - 'options': [None, '%s: size of all documents, indexes, extents' % dbase, 'KB',
529 - 'storage size metrics', 'mongodb.dbstats', 'line'],
530 - 'lines': [
531 - ['_'.join([dbase, 'dataSize']), 'documents', 'absolute', 1, 1024],
532 - ['_'.join([dbase, 'indexSize']), 'indexes', 'absolute', 1, 1024],
533 - ['_'.join([dbase, 'storageSize']), 'extents', 'absolute', 1, 1024]
534 - ]}
535 - self.definitions['dbstats_objects']['lines'].append(['_'.join([dbase, 'objects']), dbase, 'absolute'])
536 -
537 - if self.do_replica:
538 - def create_lines(hosts, string):
539 - lines = list()
540 - for host in hosts:
541 - dim_id = '_'.join([host, string])
542 - lines.append([dim_id, host, 'absolute', 1, 1000])
543 - return lines
544 -
545 - def create_state_lines(states):
546 - lines = list()
547 - for state, description in states:
548 - dim_id = '_'.join([host, 'state', state])
549 - lines.append([dim_id, description, 'absolute', 1, 1])
550 - return lines
551 -
552 - all_hosts = server_status['repl']['hosts'] + server_status['repl'].get('arbiters', list())
553 - this_host = server_status['repl']['me']
554 - other_hosts = [host for host in all_hosts if host != this_host]
555 -
556 - if 'local' in self.databases:
557 - self.order.append('oplog_window')
558 - self.definitions['oplog_window'] = {
559 - 'options': [None, 'Interval of time between the oldest and the latest entries in the oplog',
560 - 'seconds', 'replication and oplog', 'mongodb.oplog_window', 'line'],
561 - 'lines': [['timeDiff', 'window', 'absolute', 1, 1000]]}
562 - # Create "heartbeat delay" chart
563 - self.order.append('heartbeat_delay')
564 - self.definitions['heartbeat_delay'] = {
565 - 'options': [
566 - None,
567 - 'Time when last heartbeat was received from the replica set member (lastHeartbeatRecv)',
568 - 'seconds ago', 'replication and oplog', 'mongodb.replication_heartbeat_delay', 'stacked'],
569 - 'lines': create_lines(other_hosts, 'heartbeat_lag')}
570 - # Create "optimedate delay" chart
571 - self.order.append('optimedate_delay')
572 - self.definitions['optimedate_delay'] = {
573 - 'options': [None, 'Time when last entry from the oplog was applied (optimeDate)',
574 - 'seconds ago', 'replication and oplog', 'mongodb.replication_optimedate_delay', 'stacked'],
575 - 'lines': create_lines(all_hosts, 'optimedate')}
576 - # Create "replica set members state" chart
577 - for host in all_hosts:
578 - chart_name = '_'.join([host, 'state'])
579 - self.order.append(chart_name)
580 - self.definitions[chart_name] = {
581 - 'options': [None, 'Replica set member (%s) current state' % host, 'state',
582 - 'replication and oplog', 'mongodb.replication_state', 'line'],
583 - 'lines': create_state_lines(REPL_SET_STATES)}
584 -
585 - def _get_raw_data(self):
586 - raw_data = dict()
587 -
588 - raw_data.update(self.get_server_status() or dict())
589 - raw_data.update(self.get_db_stats() or dict())
590 - raw_data.update(self.get_repl_set_get_status() or dict())
591 - raw_data.update(self.get_get_replication_info() or dict())
592 -
593 - return raw_data or None
594 -
595 - def get_server_status(self):
596 - raw_data = dict()
597 - try:
598 - raw_data['serverStatus'] = self.connection.admin.command('serverStatus')
599 - except PyMongoError:
600 - return None
601 - else:
602 - return raw_data
603 -
604 - def get_db_stats(self):
605 - if not self.databases:
606 - return None
607 -
608 - raw_data = dict()
609 - raw_data['dbStats'] = dict()
610 - try:
611 - for dbase in self.databases:
612 - raw_data['dbStats'][dbase] = self.connection[dbase].command('dbStats')
613 - return raw_data
614 - except PyMongoError:
615 - return None
616 -
617 - def get_repl_set_get_status(self):
618 - if not self.do_replica:
619 - return None
620 -
621 - raw_data = dict()
622 - try:
623 - raw_data['replSetGetStatus'] = self.connection.admin.command('replSetGetStatus')
624 - return raw_data
625 - except PyMongoError:
626 - return None
627 -
628 - def get_get_replication_info(self):
629 - if not (self.do_replica and 'local' in self.databases):
630 - return None
631 -
632 - raw_data = dict()
633 - raw_data['getReplicationInfo'] = dict()
634 - try:
635 - raw_data['getReplicationInfo']['ASCENDING'] = self.connection.local.oplog.rs.find().sort(
636 - '$natural', ASCENDING).limit(1)[0]
637 - raw_data['getReplicationInfo']['DESCENDING'] = self.connection.local.oplog.rs.find().sort(
638 - '$natural', DESCENDING).limit(1)[0]
639 - return raw_data
640 - except PyMongoError:
641 - return None
642 -
643 - def _get_data(self):
644 - """
645 - :return: dict
646 - """
647 - raw_data = self._get_raw_data()
648 -
649 - if not raw_data:
650 - return None
651 -
652 - data = dict()
653 - serverStatus = raw_data['serverStatus']
654 - dbStats = raw_data.get('dbStats')
655 - replSetGetStatus = raw_data.get('replSetGetStatus')
656 - getReplicationInfo = raw_data.get('getReplicationInfo')
657 - utc_now = datetime.utcnow()
658 -
659 - # serverStatus
660 - for metric, new_name, func in self.metrics_to_collect:
661 - value = serverStatus
662 - for key in metric.split('.'):
663 - try:
664 - value = value[key]
665 - except KeyError:
666 - break
667 -
668 - if not isinstance(value, dict) and key:
669 - data[new_name or key] = value if not func else func(value)
670 -
671 - if 'mapped' in serverStatus['mem']:
672 - data['nonmapped'] = data['virtual'] - serverStatus['mem'].get('mappedWithJournal', data['mapped'])
673 -
674 - if data.get('maximum bytes configured'):
675 - maximum = data['maximum bytes configured']
676 - data['wiredTiger_percent_clean'] = int(data['bytes currently in the cache'] * 100 / maximum * 1000)
677 - data['wiredTiger_percent_dirty'] = int(data['tracked dirty bytes in the cache'] * 100 / maximum * 1000)
678 -
679 - # dbStats
680 - if dbStats:
681 - for dbase in dbStats:
682 - for metric in DBSTATS:
683 - key = '_'.join([dbase, metric])
684 - data[key] = dbStats[dbase][metric]
685 -
686 - # replSetGetStatus
687 - if replSetGetStatus:
688 - other_hosts = list()
689 - members = replSetGetStatus['members']
690 - unix_epoch = datetime(1970, 1, 1, 0, 0)
691 -
692 - for member in members:
693 - if not member.get('self'):
694 - other_hosts.append(member)
695 -
696 - # Replica set time diff between current time and time when last entry from the oplog was applied
697 - if member.get('optimeDate', unix_epoch) != unix_epoch:
698 - member_optimedate = member['name'] + '_optimedate'
699 - delta = utc_now - member['optimeDate']
700 - data[member_optimedate] = int(delta_calculation(delta=delta, multiplier=1000))
701 -
702 - # Replica set members state
703 - member_state = member['name'] + '_state'
704 - for elem in REPL_SET_STATES:
705 - state = elem[0]
706 - data.update({'_'.join([member_state, state]): 0})
707 - data.update({'_'.join([member_state, str(member['state'])]): member['state']})
708 -
709 - # Heartbeat lag calculation
710 - for other in other_hosts:
711 - if other['lastHeartbeatRecv'] != unix_epoch:
712 - node = other['name'] + '_heartbeat_lag'
713 - delta = utc_now - other['lastHeartbeatRecv']
714 - data[node] = int(delta_calculation(delta=delta, multiplier=1000))
715 -
716 - if getReplicationInfo:
717 - first_event = getReplicationInfo['ASCENDING']['ts'].as_datetime()
718 - last_event = getReplicationInfo['DESCENDING']['ts'].as_datetime()
719 - data['timeDiff'] = int(delta_calculation(delta=last_event - first_event, multiplier=1000))
720 -
721 - return data
722 -
723 - def build_ssl_connection_params(self):
724 - conf = self.configuration
725 -
726 - def cert_req(v):
727 - if v is None:
728 - return None
729 - if not v:
730 - return ssl.CERT_NONE
731 - return ssl.CERT_REQUIRED
732 -
733 - ssl_params = {
734 - CONN_PARAM_SSL_SSL: conf.get(CONN_PARAM_SSL_SSL),
735 - CONN_PARAM_SSL_CERT_REQS: cert_req(conf.get(CONN_PARAM_SSL_CERT_REQS)),
736 - CONN_PARAM_SSL_CA_CERTS: conf.get(CONN_PARAM_SSL_CA_CERTS),
737 - CONN_PARAM_SSL_CRL_FILE: conf.get(CONN_PARAM_SSL_CRL_FILE),
738 - CONN_PARAM_SSL_CERT_FILE: conf.get(CONN_PARAM_SSL_CERT_FILE),
739 - CONN_PARAM_SSL_KEY_FILE: conf.get(CONN_PARAM_SSL_KEY_FILE),
740 - CONN_PARAM_SSL_PEM_PASSPHRASE: conf.get(CONN_PARAM_SSL_PEM_PASSPHRASE),
741 - }
742 -
743 - ssl_params = dict((k, v) for k, v in ssl_params.items() if v is not None)
744 -
745 - return ssl_params
746 -
747 - def build_connection_params(self):
748 - conf = self.configuration
749 - params = {
750 - CONN_PARAM_HOST: conf.get(CONN_PARAM_HOST, DEFAULT_HOST),
751 - CONN_PARAM_PORT: conf.get(CONN_PARAM_PORT, DEFAULT_PORT),
752 - }
753 - if hasattr(MongoClient, 'server_selection_timeout') or version_tuple[0] >= 4:
754 - params[CONN_PARAM_SERVER_SELECTION_TIMEOUT_MS] = conf.get('timeout', DEFAULT_TIMEOUT)
755 -
756 - params.update(self.build_ssl_connection_params())
757 - return params
758 -
759 - def _create_connection(self):
760 - params = self.build_connection_params()
761 - self.debug('creating connection, connection params: {0}'.format(sorted(params)))
762 -
763 - try:
764 - connection = MongoClient(**params)
765 - if self.user and self.password:
766 - self.debug('authenticating, user: {0}, password: {1}'.format(self.user, self.password))
767 - getattr(connection, self.authdb).authenticate(name=self.user, password=self.password)
768 - else:
769 - self.debug('skip authenticating, user and password are not set')
770 - # elif self.user:
771 - # connection.admin.authenticate(name=self.user, mechanism='MONGODB-X509')
772 - server_status = connection.admin.command('serverStatus')
773 - except PyMongoError as error:
774 - return None, None, str(error)
775 - else:
776 - try:
777 - self.databases = connection.database_names()
778 - except PyMongoError as error:
779 - self.info('Can\'t collect databases: %s' % str(error))
780 - return connection, server_status, None
781 -
782 -
783 -def delta_calculation(delta, multiplier=1):
784 - if hasattr(delta, 'total_seconds'):
785 - return delta.total_seconds() * multiplier
786 - return (delta.microseconds + (delta.seconds + delta.days * 24 * 3600) * 10 ** 6) / 10.0 ** 6 * multiplier
collectors/python.d.plugin/mongodb/mongodb.conf deleted
-102
@@ -1,102 +0,0 @@
1 -# netdata python.d.plugin configuration for mongodb
2 -#
3 -# This file is in YaML format. Generally the format is:
4 -#
5 -# name: value
6 -#
7 -# There are 2 sections:
8 -# - global variables
9 -# - one or more JOBS
10 -#
11 -# JOBS allow you to collect values from multiple sources.
12 -# Each source will have its own set of charts.
13 -#
14 -# JOB parameters have to be indented (using spaces only, example below).
15 -
16 -# ----------------------------------------------------------------------
17 -# Global Variables
18 -# These variables set the defaults for all JOBs, however each JOB
19 -# may define its own, overriding the defaults.
20 -
21 -# update_every sets the default data collection frequency.
22 -# If unset, the python.d.plugin default is used.
23 -# update_every: 1
24 -
25 -# priority controls the order of charts at the netdata dashboard.
26 -# Lower numbers move the charts towards the top of the page.
27 -# If unset, the default for python.d.plugin is used.
28 -# priority: 60000
29 -
30 -# penalty indicates whether to apply penalty to update_every in case of failures.
31 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
32 -# penalty: yes
33 -
34 -# autodetection_retry sets the job re-check interval in seconds.
35 -# The job is not deleted if check fails.
36 -# Attempts to start the job are made once every autodetection_retry.
37 -# This feature is disabled by default.
38 -# autodetection_retry: 0
39 -
40 -# ----------------------------------------------------------------------
41 -# JOBS (data collection sources)
42 -#
43 -# The default JOBS share the same *name*. JOBS with the same name
44 -# are mutually exclusive. Only one of them will be allowed running at
45 -# any time. This allows autodetection to try several alternatives and
46 -# pick the one that works.
47 -#
48 -# Any number of jobs is supported.
49 -#
50 -# All python.d.plugin JOBS (for all its modules) support a set of
51 -# predefined parameters. These are:
52 -#
53 -# job_name:
54 -# name: myname # the JOB's name as it will appear at the
55 -# # dashboard (by default is the job_name)
56 -# # JOBs sharing a name are mutually exclusive
57 -# update_every: 1 # the JOB's data collection frequency
58 -# priority: 60000 # the JOB's order on the dashboard
59 -# penalty: yes # the JOB's penalty
60 -# autodetection_retry: 0 # the JOB's re-check interval in seconds
61 -#
62 -# Additionally to the above, mongodb also supports the following:
63 -#
64 -# host: 'IP or HOSTNAME' # type <str> the host to connect to
65 -# port: PORT # type <int> the port to connect to
66 -#
67 -# in all cases, the following can also be set:
68 -#
69 -# authdb: 'dbname' # database to authenticate the user against,
70 -# # defaults to "admin".
71 -# user: 'username' # the mongodb username to use
72 -# pass: 'password' # the mongodb password to use
73 -#
74 -# SSL connection parameters (https://api.mongodb.com/python/current/examples/tls.html):
75 -#
76 -# ssl: yes # connect to the server using TLS
77 -# ssl_cert_reqs: yes # require a certificate from the server when TLS is enabled
78 -# ssl_ca_certs: '/path/to/ca.pem' # use a specific set of CA certificates
79 -# ssl_crlfile: '/path/to/crl.pem' # use a certificate revocation lists
80 -# ssl_certfile: '/path/to/client.pem' # use a client certificate
81 -# ssl_keyfile: '/path/to/key.pem' # use a specific client certificate key
82 -# ssl_pem_passphrase: 'passphrase' # use a passphrase to decrypt encrypted private keys
83 -#
84 -
85 -# ----------------------------------------------------------------------
86 -# to connect to the mongodb on localhost, without a password:
87 -# ----------------------------------------------------------------------
88 -# AUTO-DETECTION JOBS
89 -# only one of them will run (they have the same name)
90 -
91 -local:
92 - name : 'local'
93 - host : '127.0.0.1'
94 - port : 27017
95 -
96 -# authsample:
97 -# name : 'secure'
98 -# host : 'mongodb.example.com'
99 -# port : 27017
100 -# authdb : 'admin'
101 -# user : 'monitor'
102 -# pass : 'supersecret'
collectors/python.d.plugin/ntpd/README.md
+3 -82
@@ -6,85 +6,6 @@ sidebar_label: "NTP daemon"
6
7 # NTP daemon monitoring with Netdata
8
9 -Monitors the system variables of the local `ntpd` daemon (optional incl. variables of the polled peers) using the NTP Control Message Protocol via UDP socket, similar to `ntpq`, the [standard NTP query program](http://doc.ntp.org/current-stable/ntpq.html).
10 -
11 -## Requirements
12 -
13 -- Version: `NTPv4`
14 -- Local interrogation allowed in `/etc/ntp.conf` (default):
15 -
16 -```
17 -# Local users may interrogate the ntp server more closely.
18 -restrict 127.0.0.1
19 -restrict ::1
20 -```
21 -
22 -It produces:
23 -
24 -1. system
25 -
26 - - offset
27 - - jitter
28 - - frequency
29 - - delay
30 - - dispersion
31 - - stratum
32 - - tc
33 - - precision
34 -
35 -2. peers
36 -
37 - - offset
38 - - delay
39 - - dispersion
40 - - jitter
41 - - rootdelay
42 - - rootdispersion
43 - - stratum
44 - - hmode
45 - - pmode
46 - - hpoll
47 - - ppoll
48 - - precision
49 -
50 -## Configuration
51 -
52 -Edit the `python.d/ntpd.conf` configuration file using `edit-config` from the Netdata [config
53 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
54 -
55 -```bash
56 -cd /etc/netdata # Replace this path with your Netdata config directory, if different
57 -sudo ./edit-config python.d/ntpd.conf
58 -```
59 -
60 -Sample:
61 -
62 -```yaml
63 -update_every: 10
64 -
65 -host: 'localhost'
66 -port: '123'
67 -show_peers: yes
68 -# hide peers with source address in ranges 127.0.0.0/8 and 192.168.0.0/16
69 -peer_filter: '(127\..*)|(192\.168\..*)'
70 -# check for new/changed peers every 60 updates
71 -peer_rescan: 60
72 -```
73 -
74 -Sample (multiple jobs):
75 -
76 -Note: `ntp.conf` on the host `otherhost` must be configured to allow queries from our local host by including a line like `restrict <IP> nomodify notrap nopeer`.
77 -
78 -```yaml
79 -local:
80 - host: 'localhost'
81 -
82 -otherhost:
83 - host: 'otherhost'
84 -```
85 -
86 -If no configuration is given, module will attempt to connect to `ntpd` on `::1:123` or `127.0.0.1:123` and show charts for the systemvars. Use `show_peers: yes` to also show the charts for configured peers. Local peers in the range `127.0.0.0/8` are hidden by default, use `peer_filter: ''` to show all peers.
87 -
88 ----
89 -
90 -
9 +This collector is deprecated.
10 +Use [go.d/ntpd](https://github.com/netdata/go.d.plugin/tree/master/modules/ntpd#ntp-daemon-monitoring-with-netdata)
11 +instead.
\ No newline at end of file
collectors/python.d.plugin/ntpd/ntpd.chart.py
+2
@@ -9,6 +9,8 @@ import struct
9
10 from bases.FrameworkServices.SocketService import SocketService
11
12 +disabled_by_default = True
13 +
14 # NTP Control Message Protocol constants
15 MODE = 6
16 HEADER_FORMAT = '!BBHHHHH'
collectors/python.d.plugin/proxysql/README.md
+3 -98
@@ -6,101 +6,6 @@ sidebar_label: "ProxySQL"
6
7 # ProxySQL monitoring with Netdata
8
9 -Monitors database backend and frontend performance metrics.
10 -
11 -## Requirements
12 -
13 -- python library [MySQLdb](https://github.com/PyMySQL/mysqlclient-python) (faster) or [PyMySQL](https://github.com/PyMySQL/PyMySQL) (slower)
14 -- `netdata` local user to connect to the ProxySQL server.
15 -
16 -To create the `netdata` user, follow [the documentation](https://github.com/sysown/proxysql/wiki/Users-configuration#creating-a-new-user).
17 -
18 -## Charts
19 -
20 -It produces:
21 -
22 -1. **Connections (frontend)**
23 -
24 - - connected: number of frontend connections currently connected
25 - - aborted: number of frontend connections aborted due to invalid credential or max_connections reached
26 - - non_idle: number of frontend connections that are not currently idle
27 - - created: number of frontend connections created
28 -
29 -2. **Questions (frontend)**
30 -
31 - - questions: total number of queries sent from frontends
32 - - slow_queries: number of queries that ran for longer than the threshold in milliseconds defined in global variable `mysql-long_query_time`
33 -
34 -3. **Overall Bandwidth (backends)**
35 -
36 - - in
37 - - out
38 -
39 -4. **Status (backends)**
40 -
41 - - Backends
42 - - `1=ONLINE`: backend server is fully operational
43 - - `2=SHUNNED`: backend sever is temporarily taken out of use because of either too many connection errors in a time that was too short, or replication lag exceeded the allowed threshold
44 - - `3=OFFLINE_SOFT`: when a server is put into OFFLINE_SOFT mode, new incoming connections aren't accepted anymore, while the existing connections are kept until they became inactive. In other words, connections are kept in use until the current transaction is completed. This allows to gracefully detach a backend
45 - - `4=OFFLINE_HARD`: when a server is put into OFFLINE_HARD mode, the existing connections are dropped, while new incoming connections aren't accepted either. This is equivalent to deleting the server from a hostgroup, or temporarily taking it out of the hostgroup for maintenance work
46 - - `-1`: Unknown status
47 -
48 -5. **Bandwidth (backends)**
49 -
50 - - Backends
51 - - in
52 - - out
53 -
54 -6. **Queries (backends)**
55 -
56 - - Backends
57 - - queries
58 -
59 -7. **Latency (backends)**
60 -
61 - - Backends
62 - - ping time
63 -
64 -8. **Pool connections (backends)**
65 -
66 - - Backends
67 - - Used: The number of connections are currently used by ProxySQL for sending queries to the backend server.
68 - - Free: The number of connections are currently free.
69 - - Established/OK: The number of connections were established successfully.
70 - - Error: The number of connections weren't established successfully.
71 -
72 -9. **Commands**
73 -
74 - - Commands
75 - - Count
76 - - Duration (Total duration for each command)
77 -
78 -10. **Commands Histogram**
79 -
80 - - Commands
81 - - 100us, 500us, ..., 10s, inf: the total number of commands of the given type which executed within the specified time limit and the previous one.
82 -
83 -## Configuration
84 -
85 -Edit the `python.d/proxysql.conf` configuration file using `edit-config` from the Netdata [config
86 -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`.
87 -
88 -```bash
89 -cd /etc/netdata # Replace this path with your Netdata config directory, if different
90 -sudo ./edit-config python.d/proxysql.conf
91 -```
92 -
93 -```yaml
94 -tcpipv4:
95 - name : 'local'
96 - user : 'stats'
97 - pass : 'stats'
98 - host : '127.0.0.1'
99 - port : '6032'
100 -```
101 -
102 -If no configuration is given, module will fail to run.
103 -
104 ----
105 -
106 -
9 +This collector is deprecated.
10 +Use [go.d/proxysql](https://github.com/netdata/go.d.plugin/tree/master/modules/proxysql#proxysql-monitoring-with-netdata)
11 +instead.
\ No newline at end of file
collectors/python.d.plugin/proxysql/proxysql.chart.py
+2
@@ -6,6 +6,8 @@
6 from bases.FrameworkServices.MySQLService import MySQLService
7
8
9 +disabled_by_default = True
10 +
11 def query(table, *params):
12 return 'SELECT {params} FROM {table}'.format(table=table, params=', '.join(params))
13
packaging/go.d.checksums
+17 -17
@@ -1,17 +1,17 @@
1 -f353c268259a1772a1a913c0fe1e6418bc16c0b7da30f352f104be9af93896ca *config.tar.gz
2 -e178137dc69a4dcd1409d92912f93cd8049b294f3539f6dc5baaa9c8683c2a9e *go.d.plugin-v0.47.0.darwin-amd64.tar.gz
3 -0680303753e5e01f66ed3014c31b5e2bf74cd0a14fb078066c8d542d2248bb6b *go.d.plugin-v0.47.0.darwin-arm64.tar.gz
4 -6a1934403f09fae0ba66dba912bfacae2b2a685a4579d0e6ed496e97876a5505 *go.d.plugin-v0.47.0.freebsd-386.tar.gz
5 -1efafaec4aea922952224df420d08484fc397a0dc0574b77e634c4ae5585cf88 *go.d.plugin-v0.47.0.freebsd-amd64.tar.gz
6 -ec7caf7d177f5a53acc58a65789fe5e8cdc2c4f649cc55d0e4716041e897a72a *go.d.plugin-v0.47.0.freebsd-arm.tar.gz
7 -8e665c8e89e2c7e10ca537c9d223002a77126b8e9724fc263426a01fea912ced *go.d.plugin-v0.47.0.freebsd-arm64.tar.gz
8 -2604788c36977265f7ba4bd766c54edb993df95fc95e160a7e896395a430f3d3 *go.d.plugin-v0.47.0.linux-386.tar.gz
9 -a47159980e2b1148e86ef981a0da00159501e1afd124f292ba5088fddfa46a7a *go.d.plugin-v0.47.0.linux-amd64.tar.gz
10 -b8eb244430f4fbb94db305e7e517f07d9b87195868718c8120ac9000f67b6f91 *go.d.plugin-v0.47.0.linux-arm.tar.gz
11 -d1bdd2c9788a7e566cd69922cfba2424dc1b1998ca08d56259c8e3e1f8e74e1a *go.d.plugin-v0.47.0.linux-arm64.tar.gz
12 -f3f7df6cdf57a01f0536c2105beaee4cbc8e379f7e3a132999379b7c4ed6b6ea *go.d.plugin-v0.47.0.linux-mips.tar.gz
13 -890c5bb8252bdd54fd24333f58c1b9993396f547286d3806449860be564b8e02 *go.d.plugin-v0.47.0.linux-mips64.tar.gz
14 -cebaf594e7ca203f742ab826e71154ca0085fb782b5283f79b0cda5605688720 *go.d.plugin-v0.47.0.linux-mips64le.tar.gz
15 -e6a12a2862246a1400494ba06158a4ae31736e3d271404aa9f50e354a39d2281 *go.d.plugin-v0.47.0.linux-mipsle.tar.gz
16 -a988caf128cdbce270b374cd5d16139662c1f02d4b10831a6e46e2a66ca4e4b8 *go.d.plugin-v0.47.0.linux-ppc64.tar.gz
17 -11767c948c55dc269d6db134ff04d35ab0a8de1580eb82c7b7e82c6deae02f63 *go.d.plugin-v0.47.0.linux-ppc64le.tar.gz
1 +59da5787efcee1b479f73c80f969b572bee81e3c0eabafd59a3fb40778ff7411 *config.tar.gz
2 +88d84dd7d8b3b1a55b923cadf6a31f3f4b5c144a7c6d1e73137d21a01d916154 *go.d.plugin-v0.48.0.darwin-amd64.tar.gz
3 +2525374b238b811c354d1b612ec37aef3652aba554102d87065479edbc87032d *go.d.plugin-v0.48.0.darwin-arm64.tar.gz
4 +52efcb9d163bcab8b9eea736bf12922a9d843575c2ddc04a5ad8134495de9d14 *go.d.plugin-v0.48.0.freebsd-386.tar.gz
5 +0118bb08ae5e62dc7a257f20d5a90ebc667a3761fbea93a4c8c868254bb65fe6 *go.d.plugin-v0.48.0.freebsd-amd64.tar.gz
6 +85e5a5cc218fea410ce6aa1f2b048f727df38e51f443c37b4ac1f307452e36b1 *go.d.plugin-v0.48.0.freebsd-arm.tar.gz
7 +feb5ceec4dafb316ef48d61449ac39b90ebd40fcd8d72c87b22a0c035d3a69a5 *go.d.plugin-v0.48.0.freebsd-arm64.tar.gz
8 +42397c5cd7a734d7646716d1d7412f18020b5457b3c3be50dc1f76a096ca3187 *go.d.plugin-v0.48.0.linux-386.tar.gz
9 +426207fc1f67287a3b678c21368eda71c25bc1dd1f54b9e0d8196b945cf48d7a *go.d.plugin-v0.48.0.linux-amd64.tar.gz
10 +70aedbde55b4b6ace779eba2d501a5cee9d35262afce617dc577c3bf2b755022 *go.d.plugin-v0.48.0.linux-arm.tar.gz
11 +ef1dd3b006474f930bbfaec123f5bf0b9be61a209f65355dd8f6ffc95a891260 *go.d.plugin-v0.48.0.linux-arm64.tar.gz
12 +c19584e7632647fe322c0198f00d89046580704e66da1271437cbd457596bc1e *go.d.plugin-v0.48.0.linux-mips.tar.gz
13 +8740ca5881831e916856cf260402a7f50aa2abbe88f5a24f9f15b521d61cc796 *go.d.plugin-v0.48.0.linux-mips64.tar.gz
14 +6caa43d4026a1f66426a0e5498be9847ab9b3c619de28c2181ddbe2dcddb6580 *go.d.plugin-v0.48.0.linux-mips64le.tar.gz
15 +8aa59d2d3dbc7aebfda649f469937092efaf364de790eadcc493504b69d16dd5 *go.d.plugin-v0.48.0.linux-mipsle.tar.gz
16 +ee19426ea7e172499902d0ce3833699ab314f036a71406d8c933f681159b3ec5 *go.d.plugin-v0.48.0.linux-ppc64.tar.gz
17 +f7288529ac0c3b65c725c7d72bcdab4b5d0ba51e7bcbe0cfde818d6e39eb9b97 *go.d.plugin-v0.48.0.linux-ppc64le.tar.gz
packaging/go.d.version
+1 -1
@@ -1 +1 @@
1 -v0.47.0
1 +v0.48.0