summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a0f5192)
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
+ if ((have_data & 0x03) != 0x03)
return (ENOENT);
if (isnan (swap_total)
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, "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 */