projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.10' into collectd-5.3
[collectd.git]
/
src
/
swap.c
diff --git
a/src/swap.c
b/src/swap.c
index
46d3534
..
1621f7a
100644
(file)
--- a/
src/swap.c
+++ b/
src/swap.c
@@
-339,7
+339,7
@@
static int swap_read_combined (void) /* {{{ */
fclose (fh);
fclose (fh);
- if (
have_data != 0x07
)
+ if (
(have_data & 0x03) != 0x03
)
return (ENOENT);
if (isnan (swap_total)
return (ENOENT);
if (isnan (swap_total)
@@
-351,7
+351,8
@@
static int swap_read_combined (void) /* {{{ */
swap_submit_gauge (NULL, "used", 1024.0 * swap_used);
swap_submit_gauge (NULL, "free", 1024.0 * swap_free);
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 */
return (0);
} /* }}} int swap_read_combined */