zfs_arc plugin skips hits/misses in collectd5.9.2g on 20.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
collectd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
$ lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04
$ dpkg --list | grep collectd
ii collectd-core 5.9.2.g-1ubuntu5 amd64 statistics collection and monitoring daemon (core system)
The zfs_arc plug-in for collectd is broken in 5.9.2g for the "hits" and "misses" lines of /proc/spl/
I was able to confirm that just by taking /usr/lib/
Then I rebuilt the package from source with a single hunk of code removed from zfs_arc.c that was not present in 5.9.2, introduced in 5.9.2g, and removed again in upstream debian 5.10.0. This fixes the issue.
I also traced it to the collectd upstream and there the change was made as part of commit 0cc3044f with a commit message that specifically describes the problem.
--- collectd.
+++ collectd.
@@ -231,23 +231,6 @@
return -1;
}
- // Ignore the first two lines because they contain information about
- // the rest of the file.
- // See kstat_seq_
- // module.
- if (fgets(buffer, sizeof(buffer), fh) == NULL) {
- ERROR("zfs_arc plugin: \"%s\" does not contain a single line.",
- ZOL_ARCSTATS_FILE);
- fclose(fh);
- return (-1);
- }
- if (fgets(buffer, sizeof(buffer), fh) == NULL) {
- ERROR("zfs_arc plugin: \"%s\" does not contain at least two lines.",
- ZOL_ARCSTATS_FILE);
- fclose(fh);
- return (-1);
- }
-
while (fgets(buffer, sizeof(buffer), fh) != NULL) {
char *fields[3];
value_t v;
summary: |
- ARC Hit Ratio does not work in collectd zfs_arc + zfs_arc plugin skips hits/misses in collectd5.9.2g on 20.04 |
description: | updated |