Move mdstat python module to proc plugin (#4768)
* Add mdstat health chart * Add disks configuration charts * Add operation data collection * Add operation charts * Fix data types * Add mismatch_cnt charts * Handle raid renaming properly, major cleanup * Add modification time checks for mismatch_cnt files * Disable python module, minor cleanup * Add mdstat section to the proc plugin documentation * Remove modification time checks * Fix update conditions * Move mismatch_cnt config option * Minor documentation fix
Vladimir Kobal committed
Dec 5, 2018 at 11:46 UTC
522ac6a532003d17db1dfc63621f5fb4c5fa7915
9 files changed
+512
-4
Makefile.am
+1
@@ -237,6 +237,7 @@ PROC_PLUGIN_FILES = \
237
collectors/proc.plugin/plugin_proc.c \
238
collectors/proc.plugin/plugin_proc.h \
239
collectors/proc.plugin/proc_diskstats.c \
240
+ collectors/proc.plugin/proc_mdstat.c \
241
collectors/proc.plugin/proc_interrupts.c \
242
collectors/proc.plugin/proc_softirqs.c \
243
collectors/proc.plugin/proc_loadavg.c \
collectors/all.h
+9
@@ -298,6 +298,15 @@
298
#define NETDATA_CHART_PRIO_SYNPROXY_CONN_OPEN 8753
299
#define NETDATA_CHART_PRIO_SYNPROXY_ENTRIES 8754
300
301
+// MDSTAT
302
+
303
+#define NETDATA_CHART_PRIO_MDSTAT_HEALTH 9000
304
+#define NETDATA_CHART_PRIO_MDSTAT_DISKS 9001 // 5 charts per raid
305
+#define NETDATA_CHART_PRIO_MDSTAT_MISMATCH 9002
306
+#define NETDATA_CHART_PRIO_MDSTAT_OPERATION 9003
307
+#define NETDATA_CHART_PRIO_MDSTAT_FINISH 9004
308
+#define NETDATA_CHART_PRIO_MDSTAT_SPEED 9005
309
+
310
// CGROUPS
311
312
#define NETDATA_CHART_PRIO_CGROUPS_SYSTEMD 19000 // many charts
collectors/proc.plugin/README.md
+35
-3
@@ -2,6 +2,7 @@
2
3
- `/proc/net/dev` (all network interfaces for all their values)
4
- `/proc/diskstats` (all disks for all their values)
5
+ - `/proc/mdstat` (status of RAID arrays)
6
- `/proc/net/snmp` (total IPv4, TCP and UDP usage)
7
- `/proc/net/snmp6` (total IPv6 usage)
8
- `/proc/net/netstat` (more IPv4 usage)
@@ -117,7 +118,7 @@ Then edit `netdata.conf` and find the following section. This is the basic plugi
118
# path to get h/w sector size = /sys/block/%s/queue/hw_sector_size
119
# path to get h/w sector size for partitions = /sys/dev/block/%lu:%lu/subsystem/%s/../queue
120
/hw_sector_size
120
-
121
+
122
```
123
124
For each virtual disk, physical disk and partition you will have a section like this:
@@ -160,13 +161,44 @@ But sometimes you need disable performance metrics for all devices with the same
161
251 2 zram2 27487 0 219896 188 79953 0 639624 1640 0 1828 1828
162
251 3 zram3 27348 0 218784 152 79952 0 639616 1960 0 2060 2104
163
```
163
-All zram devices starts with `251` number and all loop devices starts with `7`.
164
+All zram devices starts with `251` number and all loop devices starts with `7`.
165
So, to disable performance metrics for all loop devices you could add `performance metrics for disks with major 7 = no` to `[plugin:proc:/proc/diskstats]` section.
166
```
167
[plugin:proc:/proc/diskstats]
168
performance metrics for disks with major 7 = no
169
```
170
171
+## Monitoring RAID arrays
172
+
173
+### Monitored RAID array metrics
174
+
175
+1. **Health** Number of failed disks in every array (aggregate chart).
176
+
177
+2. **Disks stats**
178
+ * total (number of devices array ideally would have)
179
+ * inuse (number of devices currently are in use)
180
+
181
+3. **Mismatch count**
182
+ * unsynchronized blocks
183
+
184
+4. **Current status**
185
+ * resync in percent
186
+ * recovery in percent
187
+ * reshape in percent
188
+ * check in percent
189
+
190
+5. **Operation status** (if resync/recovery/reshape/check is active)
191
+ * finish in minutes
192
+ * speed in megabytes/s
193
+
194
+#### configuration
195
+
196
+```
197
+[plugin:proc:/proc/mdstat]
198
+ # mismatch_cnt filename to monitor = /sys/block/%s/md/mismatch_cnt
199
+ # filename to monitor = /proc/mdstat
200
+```
201
+
202
## Monitoring CPUs
203
204
The `/proc/stat` module monitors CPU utilization, interrupts, context switches, processes started/running, thermal throttling, frequency, and idle states. It gathers this information from multiple files.
@@ -239,4 +271,4 @@ Example image:
271
272

273
242
-See Linux Anti-DDoS in action at: **[netdata demo site (with SYNPROXY enabled)](https://registry.my-netdata.io/#menu_netfilter_submenu_synproxy)**
274
+See Linux Anti-DDoS in action at: **[netdata demo site (with SYNPROXY enabled)](https://registry.my-netdata.io/#menu_netfilter_submenu_synproxy)**
collectors/proc.plugin/plugin_proc.c
+1
@@ -49,6 +49,7 @@ static struct proc_module {
49
50
// disk metrics
51
{ .name = "/proc/diskstats", .dim = "diskstats", .func = do_proc_diskstats },
52
+ { .name = "/proc/mdstat", .dim = "mdstat", .func = do_proc_mdstat },
53
54
// NFS metrics
55
{ .name = "/proc/net/rpc/nfsd", .dim = "nfsd", .func = do_proc_net_rpc_nfsd },
collectors/proc.plugin/plugin_proc.h
+1
@@ -26,6 +26,7 @@ extern void *proc_main(void *ptr);
26
27
extern int do_proc_net_dev(int update_every, usec_t dt);
28
extern int do_proc_diskstats(int update_every, usec_t dt);
29
+extern int do_proc_mdstat(int update_every, usec_t dt);
30
extern int do_proc_net_snmp(int update_every, usec_t dt);
31
extern int do_proc_net_snmp6(int update_every, usec_t dt);
32
extern int do_proc_net_netstat(int update_every, usec_t dt);
collectors/proc.plugin/proc_mdstat.c
new
+454
@@ -0,0 +1,454 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+#include "plugin_proc.h"
4
+
5
+#define PLUGIN_PROC_MODULE_MDSTAT_NAME "/proc/mdstat"
6
+
7
+struct raid {
8
+ int used;
9
+ char *name;
10
+ RRDDIM *rd_health;
11
+ unsigned long long failed_disks;
12
+
13
+ RRDSET *st_disks;
14
+ RRDDIM *rd_total;
15
+ RRDDIM *rd_inuse;
16
+ unsigned long long total_disks;
17
+ unsigned long long inuse_disks;
18
+
19
+ RRDSET *st_operation;
20
+ RRDDIM *rd_check;
21
+ RRDDIM *rd_resync;
22
+ RRDDIM *rd_recovery;
23
+ RRDDIM *rd_reshape;
24
+ unsigned long long check;
25
+ unsigned long long resync;
26
+ unsigned long long recovery;
27
+ unsigned long long reshape;
28
+
29
+ RRDSET *st_finish;
30
+ RRDDIM *rd_finish_in;
31
+ unsigned long long finish_in;
32
+
33
+ RRDSET *st_speed;
34
+ RRDDIM *rd_speed;
35
+ unsigned long long speed;
36
+
37
+ char *mismatch_cnt_filename;
38
+ RRDSET *st_mismatch_cnt;
39
+ RRDDIM *rd_mismatch_cnt;
40
+ unsigned long long mismatch_cnt;
41
+};
42
+
43
+static inline char *remove_trailing_chars(char *s, char c) {
44
+ while(*s) {
45
+ if(unlikely(*s == c)) {
46
+ *s = '\0';
47
+ }
48
+ s++;
49
+ }
50
+ return s;
51
+}
52
+
53
+int do_proc_mdstat(int update_every, usec_t dt) {
54
+ (void)dt;
55
+ static procfile *ff = NULL;
56
+ static char *mdstat_filename = NULL, *mismatch_cnt_filename = NULL;
57
+ static struct raid *raids = NULL;
58
+ static size_t raids_num = 0, raids_allocated = 0;
59
+ size_t raid_idx = 0;
60
+
61
+ if(unlikely(!mismatch_cnt_filename)) {
62
+ char filename[FILENAME_MAX + 1];
63
+ snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/sys/block/%s/md/mismatch_cnt");
64
+ mismatch_cnt_filename = config_get("plugin:proc:/proc/mdstat", "mismatch_cnt filename to monitor", filename);
65
+ }
66
+
67
+ if(unlikely(!ff)) {
68
+ char filename[FILENAME_MAX + 1];
69
+ snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/mdstat");
70
+ mdstat_filename = config_get("plugin:proc:/proc/mdstat", "filename to monitor", filename);
71
+ ff = procfile_open(mdstat_filename, " \t:", PROCFILE_FLAG_DEFAULT);
72
+ if(unlikely(!ff)) return 1;
73
+ }
74
+
75
+ ff = procfile_readall(ff);
76
+ if(unlikely(!ff)) return 0; // we return 0, so that we will retry opening it next time
77
+
78
+ size_t lines = procfile_lines(ff);
79
+ size_t words = 0;
80
+
81
+ if(unlikely(lines < 2)) {
82
+ error("Cannot read /proc/mdstat. Expected 2 or more lines, read %zu.", lines);
83
+ return 1;
84
+ }
85
+
86
+ // find how many raids are there
87
+ size_t l;
88
+ raids_num = 0;
89
+ for(l = 1; l < lines - 2 ; l++) {
90
+ if(unlikely(procfile_lineword(ff, l, 1)[0] == 'a')) // check if the raid is active
91
+ raids_num++;
92
+ }
93
+
94
+ if(unlikely(!raids_num)) return 0; // we return 0, so that we will retry searching for raids next time
95
+
96
+ // allocate the memory we need;
97
+ if(unlikely(raids_num != raids_allocated)) {
98
+ for(raid_idx = 0; raid_idx < raids_allocated; raid_idx++) {
99
+ struct raid *raid = &raids[raid_idx];
100
+ freez(raid->name);
101
+ freez(raid->mismatch_cnt_filename);
102
+ }
103
+ raids = (struct raid *)reallocz(raids, raids_num * sizeof(struct raid));
104
+ raids_allocated = raids_num;
105
+ memset(raids, 0, raids_num * sizeof(struct raid));
106
+ }
107
+
108
+ // loop through all lines except the first and the last ones
109
+ for(l = 1, raid_idx = 0; l < (lines - 2) && raid_idx < raids_num; l++) {
110
+ struct raid *raid = &raids[raid_idx];
111
+ raid->used = 0;
112
+
113
+ words = procfile_linewords(ff, l);
114
+ if(unlikely(words < 2)) continue;
115
+
116
+ if(unlikely(procfile_lineword(ff, l, 1)[0] != 'a')) continue;
117
+ if(!raid->name) {
118
+ raid->name = strdupz(procfile_lineword(ff, l, 0));
119
+ }
120
+ else if(strcmp(raid->name, procfile_lineword(ff, l, 0))) {
121
+ freez(raid->name);
122
+ freez(raid->mismatch_cnt_filename);
123
+ memset(raid, 0, sizeof(struct raid));
124
+ raid->name = strdupz(procfile_lineword(ff, l, 0));
125
+ }
126
+ if(unlikely(!raid->name || !raid->name[0])) continue;
127
+ raid_idx++;
128
+
129
+ // check if raid has disk status
130
+ l++;
131
+ words = procfile_linewords(ff, l);
132
+ if(words < 2 || procfile_lineword(ff, l, words - 1)[0] != '[') {
133
+ continue;
134
+ }
135
+
136
+ // split inuse and total number of disks
137
+ char *s = NULL, *str_total = NULL, *str_inuse = NULL;
138
+
139
+ s = procfile_lineword(ff, l, words - 2);
140
+ if(unlikely(s[0] != '[')) {
141
+ error("Cannot read /proc/mdstat raid health status. Unexpected format: missing opening bracket.");
142
+ continue;
143
+ }
144
+ str_total = ++s;
145
+ while(*s) {
146
+ if(unlikely(*s == '/')) {
147
+ *s = '\0';
148
+ str_inuse = s + 1;
149
+ }
150
+ else if(unlikely(*s == ']')) {
151
+ *s = '\0';
152
+ break;
153
+ }
154
+ s++;
155
+ }
156
+ if(unlikely(str_total[0] == '\0' || str_inuse[0] == '\0')) {
157
+ error("Cannot read /proc/mdstat raid health status. Unexpected format.");
158
+ continue;
159
+ }
160
+
161
+ raid->inuse_disks = str2ull(str_inuse);
162
+ raid->total_disks = str2ull(str_total);
163
+ raid->failed_disks = raid->total_disks - raid->inuse_disks;
164
+
165
+ raid->used = 1;
166
+
167
+ raid->check = 0;
168
+ raid->resync = 0;
169
+ raid->recovery = 0;
170
+ raid->reshape = 0;
171
+ raid->finish_in = 0;
172
+ raid->speed = 0;
173
+
174
+ // check if any operation is performed on the raid
175
+ l++;
176
+ words = procfile_linewords(ff, l);
177
+ if(likely(words < 2)) continue;
178
+ if(unlikely(words < 7)) {
179
+ error("Cannot read /proc/mdstat line. Expected 7 params, read %zu.", words);
180
+ continue;
181
+ }
182
+ if(unlikely(procfile_lineword(ff, l, 0)[0] != '[')) continue;
183
+ char *word;
184
+
185
+ word = procfile_lineword(ff, l, 3);
186
+ remove_trailing_chars(word, '%');
187
+
188
+ unsigned long long percentage = (unsigned long long)(str2ld(word, NULL) * 100);
189
+ // possible operations: check, resync, recovery, reshape
190
+ // 4-th character is unique for each operation so it is checked
191
+ switch(procfile_lineword(ff, l, 1)[3]) {
192
+ case 'c': // check
193
+ raid->check = percentage;
194
+ break;
195
+ case 'y': // resync
196
+ raid->resync = percentage;
197
+ break;
198
+ case 'o': // recovery
199
+ raid->recovery = percentage;
200
+ break;
201
+ case 'h': // reshape
202
+ raid->reshape = percentage;
203
+ break;
204
+ }
205
+
206
+ word = procfile_lineword(ff, l, 5);
207
+ s = remove_trailing_chars(word, 'm'); // remove trailing "min"
208
+
209
+ word += 7; // skip leading "finish="
210
+
211
+ if(likely(s > word))
212
+ raid->finish_in = (unsigned long long)(str2ld(word, NULL) * 60);
213
+
214
+ word = procfile_lineword(ff, l, 6);
215
+ s = remove_trailing_chars(word, 'K'); // remove trailing "K/sec"
216
+
217
+ word += 6; // skip leading "speed="
218
+
219
+ if(likely(s > word))
220
+ raid->speed = str2ull(word);
221
+ }
222
+
223
+ // read mismatch_cnt files
224
+ for(raid_idx = 0; raid_idx < raids_num ; raid_idx++) {
225
+ char filename[FILENAME_MAX + 1];
226
+ struct raid *raid = &raids[raid_idx];
227
+
228
+ if(likely(raid->used)) {
229
+ if(!raid->mismatch_cnt_filename) {
230
+ snprintfz(filename, FILENAME_MAX, mismatch_cnt_filename, raid->name);
231
+ raid->mismatch_cnt_filename = strdupz(filename);
232
+ }
233
+ if(unlikely(read_single_number_file(raid->mismatch_cnt_filename, &raid->mismatch_cnt))) {
234
+ error("Cannot read file '%s'", raid->mismatch_cnt_filename);
235
+ return 1;
236
+ }
237
+ }
238
+ }
239
+
240
+ // --------------------------------------------------------------------
241
+
242
+ static RRDSET *st_mdstat_health = NULL;
243
+ if(unlikely(!st_mdstat_health))
244
+ st_mdstat_health = rrdset_create_localhost(
245
+ "mdstat"
246
+ , "mdstat_health"
247
+ , NULL
248
+ , "health"
249
+ , "md.health"
250
+ , "Faulty Devices In MD"
251
+ , "failed disks"
252
+ , PLUGIN_PROC_NAME
253
+ , PLUGIN_PROC_MODULE_MDSTAT_NAME
254
+ , NETDATA_CHART_PRIO_MDSTAT_HEALTH
255
+ , update_every
256
+ , RRDSET_TYPE_LINE
257
+ );
258
+ else
259
+ rrdset_next(st_mdstat_health);
260
+
261
+ for(raid_idx = 0; raid_idx < raids_num; raid_idx++) {
262
+ struct raid *raid = &raids[raid_idx];
263
+
264
+ if(likely(raid->used)) {
265
+ if(unlikely(!raid->rd_health && !(raid->rd_health = rrddim_find(st_mdstat_health, raid->name))))
266
+ raid->rd_health = rrddim_add(st_mdstat_health, raid->name, NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
267
+
268
+ rrddim_set_by_pointer(st_mdstat_health, raid->rd_health, raid->failed_disks);
269
+ }
270
+ }
271
+
272
+ rrdset_done(st_mdstat_health);
273
+
274
+ // --------------------------------------------------------------------
275
+
276
+ for(raid_idx = 0; raid_idx < raids_num ; raid_idx++) {
277
+ struct raid *raid = &raids[raid_idx];
278
+ char id[50 + 1];
279
+ char family[50 + 1];
280
+
281
+ if(likely(raid->used)) {
282
+ snprintfz(id, 50, "%s_disks", raid->name);
283
+
284
+ if(unlikely(!raid->st_disks && !(raid->st_disks = rrdset_find_byname_localhost(id)))) {
285
+ snprintfz(family, 50, "%s", raid->name);
286
+ raid->st_disks = rrdset_create_localhost(
287
+ "mdstat"
288
+ , id
289
+ , NULL
290
+ , family
291
+ , "md.disks"
292
+ , "Disks Stats"
293
+ , "disks"
294
+ , PLUGIN_PROC_NAME
295
+ , PLUGIN_PROC_MODULE_MDSTAT_NAME
296
+ , NETDATA_CHART_PRIO_MDSTAT_DISKS + raid_idx * 10
297
+ , update_every
298
+ , RRDSET_TYPE_STACKED
299
+ );
300
+ }
301
+ else
302
+ rrdset_next(raid->st_disks);
303
+
304
+ if(unlikely(!raid->rd_inuse && !(raid->rd_inuse = rrddim_find(raid->st_disks, "inuse"))))
305
+ raid->rd_inuse = rrddim_add(raid->st_disks, "inuse", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
306
+ if(unlikely(!raid->rd_total && !(raid->rd_total = rrddim_find(raid->st_disks, "total"))))
307
+ raid->rd_total = rrddim_add(raid->st_disks, "total", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
308
+
309
+ rrddim_set_by_pointer(raid->st_disks, raid->rd_inuse, raid->inuse_disks);
310
+ rrddim_set_by_pointer(raid->st_disks, raid->rd_total, raid->total_disks);
311
+
312
+ rrdset_done(raid->st_disks);
313
+
314
+ // --------------------------------------------------------------------
315
+
316
+ snprintfz(id, 50, "%s_mismatch", raid->name);
317
+
318
+ if(unlikely(!raid->st_mismatch_cnt && !(raid->st_mismatch_cnt = rrdset_find_byname_localhost(id)))) {
319
+ snprintfz(family, 50, "%s", raid->name);
320
+
321
+ raid->st_mismatch_cnt = rrdset_create_localhost(
322
+ "mdstat"
323
+ , id
324
+ , NULL
325
+ , family
326
+ , "md.mismatch_cnt"
327
+ , "Mismatch Count"
328
+ , "unsynchronized blocks"
329
+ , PLUGIN_PROC_NAME
330
+ , PLUGIN_PROC_MODULE_MDSTAT_NAME
331
+ , NETDATA_CHART_PRIO_MDSTAT_MISMATCH + raid_idx * 10
332
+ , update_every
333
+ , RRDSET_TYPE_LINE
334
+ );
335
+ }
336
+ else
337
+ rrdset_next(raid->st_mismatch_cnt);
338
+
339
+ if(unlikely(!raid->rd_mismatch_cnt && !(raid->rd_mismatch_cnt = rrddim_find(raid->st_mismatch_cnt, "count"))))
340
+ raid->rd_mismatch_cnt = rrddim_add(raid->st_mismatch_cnt, "count", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
341
+
342
+ rrddim_set_by_pointer(raid->st_mismatch_cnt, raid->rd_mismatch_cnt, raid->mismatch_cnt);
343
+
344
+ rrdset_done(raid->st_mismatch_cnt);
345
+
346
+ // --------------------------------------------------------------------
347
+
348
+ snprintfz(id, 50, "%s_operation", raid->name);
349
+
350
+ if(unlikely(!raid->st_operation && !(raid->st_operation = rrdset_find_byname_localhost(id)))) {
351
+ snprintfz(family, 50, "%s", raid->name);
352
+
353
+ raid->st_operation = rrdset_create_localhost(
354
+ "mdstat"
355
+ , id
356
+ , NULL
357
+ , family
358
+ , "md.status"
359
+ , "Current Status"
360
+ , "percent"
361
+ , PLUGIN_PROC_NAME
362
+ , PLUGIN_PROC_MODULE_MDSTAT_NAME
363
+ , NETDATA_CHART_PRIO_MDSTAT_OPERATION + raid_idx * 10
364
+ , update_every
365
+ , RRDSET_TYPE_LINE
366
+ );
367
+ }
368
+ else
369
+ rrdset_next(raid->st_operation);
370
+
371
+ if(unlikely(!raid->rd_check && !(raid->rd_check = rrddim_find(raid->st_operation, "check"))))
372
+ raid->rd_check = rrddim_add(raid->st_operation, "check", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
373
+ if(unlikely(!raid->rd_resync && !(raid->rd_resync = rrddim_find(raid->st_operation, "resync"))))
374
+ raid->rd_resync = rrddim_add(raid->st_operation, "resync", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
375
+ if(unlikely(!raid->rd_recovery && !(raid->rd_recovery = rrddim_find(raid->st_operation, "recovery"))))
376
+ raid->rd_recovery = rrddim_add(raid->st_operation, "recovery", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
377
+ if(unlikely(!raid->rd_reshape && !(raid->rd_reshape = rrddim_find(raid->st_operation, "reshape"))))
378
+ raid->rd_reshape = rrddim_add(raid->st_operation, "reshape", NULL, 1, 100, RRD_ALGORITHM_ABSOLUTE);
379
+
380
+ rrddim_set_by_pointer(raid->st_operation, raid->rd_check, raid->check);
381
+ rrddim_set_by_pointer(raid->st_operation, raid->rd_resync, raid->resync);
382
+ rrddim_set_by_pointer(raid->st_operation, raid->rd_recovery, raid->recovery);
383
+ rrddim_set_by_pointer(raid->st_operation, raid->rd_reshape, raid->reshape);
384
+
385
+ rrdset_done(raid->st_operation);
386
+
387
+ // --------------------------------------------------------------------
388
+
389
+ snprintfz(id, 50, "%s_finish", raid->name);
390
+
391
+ if(unlikely(!raid->st_finish && !(raid->st_finish = rrdset_find_byname_localhost(id)))) {
392
+ snprintfz(family, 50, "%s", raid->name);
393
+
394
+ raid->st_finish = rrdset_create_localhost(
395
+ "mdstat"
396
+ , id
397
+ , NULL
398
+ , family
399
+ , "md.rate"
400
+ , "Approximate Time Unit Finish"
401
+ , "seconds"
402
+ , PLUGIN_PROC_NAME
403
+ , PLUGIN_PROC_MODULE_MDSTAT_NAME
404
+ , NETDATA_CHART_PRIO_MDSTAT_FINISH + raid_idx * 10
405
+ , update_every
406
+ , RRDSET_TYPE_LINE
407
+ );
408
+ }
409
+ else
410
+ rrdset_next(raid->st_finish);
411
+
412
+ if(unlikely(!raid->rd_finish_in && !(raid->rd_finish_in = rrddim_find(raid->st_finish, "finish_in"))))
413
+ raid->rd_finish_in = rrddim_add(raid->st_finish, "finish_in", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
414
+
415
+ rrddim_set_by_pointer(raid->st_finish, raid->rd_finish_in, raid->finish_in);
416
+
417
+ rrdset_done(raid->st_finish);
418
+
419
+ // --------------------------------------------------------------------
420
+
421
+ snprintfz(id, 50, "%s_speed", raid->name);
422
+
423
+ if(unlikely(!raid->st_speed && !(raid->st_speed = rrdset_find_byname_localhost(id)))) {
424
+ snprintfz(family, 50, "%s", raid->name);
425
+
426
+ raid->st_speed = rrdset_create_localhost(
427
+ "mdstat"
428
+ , id
429
+ , NULL
430
+ , family
431
+ , "md.rate"
432
+ , "Operation Speed"
433
+ , "KB/s"
434
+ , PLUGIN_PROC_NAME
435
+ , PLUGIN_PROC_MODULE_MDSTAT_NAME
436
+ , NETDATA_CHART_PRIO_MDSTAT_SPEED + raid_idx * 10
437
+ , update_every
438
+ , RRDSET_TYPE_LINE
439
+ );
440
+ }
441
+ else
442
+ rrdset_next(raid->st_speed);
443
+
444
+ if(unlikely(!raid->rd_speed && !(raid->rd_speed = rrddim_find(raid->st_speed, "speed"))))
445
+ raid->rd_speed = rrddim_add(raid->st_speed, "speed", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
446
+
447
+ rrddim_set_by_pointer(raid->st_speed, raid->rd_speed, raid->speed);
448
+
449
+ rrdset_done(raid->st_speed);
450
+ }
451
+ }
452
+
453
+ return 0;
454
+}
collectors/python.d.plugin/cpufreq/README.md
+5
@@ -1,5 +1,10 @@
1
# cpufreq
2
3
+> THIS MODULE IS OBSOLETE.
4
+> USE THE [PROC PLUGIN](../../proc.plugin) - IT IS MORE EFFICIENT
5
+
6
+---
7
+
8
This module shows the current CPU frequency as set by the cpufreq kernel
9
module.
10
collectors/python.d.plugin/mdstat/README.md
+5
@@ -1,5 +1,10 @@
1
# mdstat
2
3
+> THIS MODULE IS OBSOLETE.
4
+> USE THE [PROC PLUGIN](../../proc.plugin) - IT IS MORE EFFICIENT
5
+
6
+---
7
+
8
Module monitor /proc/mdstat
9
10
It produces:
collectors/python.d.plugin/python.d.plugin.in
+1
-1
@@ -56,7 +56,7 @@ BASE_CONFIG = {'update_every': os.getenv('NETDATA_UPDATE_EVERY', 1),
56
57
58
MODULE_EXTENSION = '.chart.py'
59
-OBSOLETE_MODULES = ['apache_cache', 'gunicorn_log', 'nginx_log', 'cpufreq', 'cpuidle']
59
+OBSOLETE_MODULES = ['apache_cache', 'gunicorn_log', 'nginx_log', 'cpufreq', 'cpuidle', 'mdstat']
60
61
62
def module_ok(m):