1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# mongodb
Module monitor mongodb performance and health metrics
**Requirements:**
* `python-pymongo` package v2.4+.
You need to install it manually.
Number of charts depends on mongodb version, storage engine and other features (replication):
1. **Read requests**:
* query
* getmore (operation the cursor executes to get additional data from query)
2. **Write requests**:
* insert
* delete
* update
3. **Active clients**:
* readers (number of clients with read operations in progress or queued)
* writers (number of clients with write operations in progress or queued)
4. **Journal transactions**:
* commits (count of transactions that have been written to the journal)
5. **Data written to the journal**:
* volume (volume of data)
6. **Background flush** (MMAPv1):
* average ms (average time taken by flushes to execute)
* last ms (time taken by the last flush)
8. **Read tickets** (WiredTiger):
* in use (number of read tickets in use)
* available (number of available read tickets remaining)
9. **Write tickets** (WiredTiger):
* in use (number of write tickets in use)
* available (number of available write tickets remaining)
10. **Cursors**:
* opened (number of cursors currently opened by MongoDB for clients)
* timedOut (number of cursors that have timed)
* noTimeout (number of open cursors with timeout disabled)
11. **Connections**:
* connected (number of clients currently connected to the database server)
* unused (number of unused connections available for new clients)
12. **Memory usage metrics**:
* virtual
* resident (amount of memory used by the database process)
* mapped
* non mapped
13. **Page faults**:
* page faults (number of times MongoDB had to request from disk)
14. **Cache metrics** (WiredTiger):
* percentage of bytes currently in the cache (amount of space taken by cached data)
* percantage of tracked dirty bytes in the cache (amount of space taken by dirty data)
15. **Pages evicted from cache** (WiredTiger):
* modified
* unmodified
16. **Queued requests**:
* readers (number of read request currently queued)
* writers (number of write request currently queued)
17. **Errors**:
* msg (number of message assertions raised)
* warning (number of warning assertions raised)
* regular (number of regular assertions raised)
* user (number of assertions corresponding to errors generated by users)
18. **Storage metrics** (one chart for every database)
* dataSize (size of all documents + padding in the database)
* indexSize (size of all indexes in the database)
* storageSize (size of all extents in the database)
19. **Documents in the database** (one chart for all databases)
* documents (number of objects in the database among all the collections)
20. **tcmalloc metrics**
* central cache free
* current total thread cache
* pageheap free
* pageheap unmapped
* thread cache free
* transfer cache free
* heap size
21. **Commands total/failed rate**
* count
* createIndex
* delete
* eval
* findAndModify
* insert
22. **Locks metrics** (acquireCount metrics - number of times the lock was acquired in the specified mode)
* Global lock
* Database lock
* Collection lock
* Metadata lock
* oplog lock
23. **Replica set members state**
* state
24. **Oplog window**
* window (interval of time between the oldest and the latest entries in the oplog)
25. **Replication lag**
* member (time when last entry from the oplog was applied for every member)
26. **Replication set member heartbeat latency**
* member (time when last heartbeat was received from replica set member)
### prerequisite
Create a read-only user for the netdata in the admin database.
1. Authenticate as the admin user.
```
use admin
db.auth("admin", "<MONGODB_ADMIN_PASSWORD>")
```
2. Create a user.
```
# MongoDB 2.x.
db.addUser("netdata", "<UNIQUE_PASSWORD>", true)
# MongoDB 3.x or higher.
db.createUser({
"user":"netdata",
"pwd": "<UNIQUE_PASSWORD>",
"roles" : [
{role: 'read', db: 'admin' },
{role: 'clusterMonitor', db: 'admin'},
{role: 'read', db: 'local' }
]
})
```
### configuration
Sample:
```yaml
local:
name : 'local'
host : '127.0.0.1'
port : 27017
user : 'netdata'
pass : 'netdata'
```
If no configuration is given, module will attempt to connect to mongodb daemon on `127.0.0.1:27017` address
---
|