summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0f5192)
raw | patch | inline | side by side (parent: a0f5192)
author | Florian Forster <octo@collectd.org> | |
Wed, 17 Sep 2014 05:41:38 +0000 (07:41 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 17 Sep 2014 05:41:38 +0000 (07:41 +0200) |
This is the smallest possible fix for OpenVZ, where cached is not available.
master has a more complete fix which should be used going forward.
Fixes: #733
master has a more complete fix which should be used going forward.
Fixes: #733
src/swap.c | patch | blob | history |
diff --git a/src/swap.c b/src/swap.c
index 46d3534fcae818cd6fc286cd448d824ad22ccad8..1621f7af677a2a83ee866ee752cece72fcea3c60 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
fclose (fh);
- if (have_data != 0x07)
+ if ((have_data & 0x03) != 0x03)
return (ENOENT);
if (isnan (swap_total)
swap_submit_gauge (NULL, "used", 1024.0 * swap_used);
swap_submit_gauge (NULL, "free", 1024.0 * swap_free);
- swap_submit_gauge (NULL, "cached", 1024.0 * swap_cached);
+ if (have_data & 0x04)
+ swap_submit_gauge (NULL, "cached", 1024.0 * swap_cached);
return (0);
} /* }}} int swap_read_combined */