#include "common.h"
-int do_proc_meminfo(int update_every, unsigned long long dt) {
+int do_proc_meminfo(int update_every, usec_t dt) {
(void)dt;
static procfile *ff = NULL;
return 0; // we return 0, so that we will retry to open it next time
uint32_t lines = procfile_lines(ff), l;
- uint32_t words;
int hwcorrupted = 0;
HardwareCorrupted = 0;
for(l = 0; l < lines ;l++) {
- words = procfile_linewords(ff, l);
+ uint32_t words = procfile_linewords(ff, l);
if(unlikely(words < 2)) continue;
char *name = procfile_lineword(ff, l, 0);
// --------------------------------------------------------------------
- if(hwcorrupted && do_hwcorrupt && HardwareCorrupted > 0) {
+ if(hwcorrupted && (do_hwcorrupt == CONFIG_ONDEMAND_YES || (do_hwcorrupt == CONFIG_ONDEMAND_ONDEMAND && HardwareCorrupted > 0))) {
do_hwcorrupt = CONFIG_ONDEMAND_YES;
st = rrdset_find("mem.hwcorrupt");
if(!st) {
- st = rrdset_create("mem", "hwcorrupt", NULL, "errors", NULL, "Hardware Corrupted ECC", "MB", 9000, update_every, RRDSET_TYPE_LINE);
+ st = rrdset_create("mem", "hwcorrupt", NULL, "ecc", NULL, "Hardware Corrupted ECC", "MB", 9000, update_every, RRDSET_TYPE_LINE);
st->isdetail = 1;
rrddim_add(st, "HardwareCorrupted", NULL, 1, 1024, RRDDIM_ABSOLUTE);