Public bug reported:

$ 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 "ARC Hit Ratio" 
graph: the graph does not populate with any information at all (all data points 
come back -nan).

I was able to confirm that just by taking /usr/lib/collectd/zfs_arc.so
from a working 18.04 installation and dropping it on the 20.04 box, the
problem could be resolved.

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:

--- collectd.5.9.2g/zfs_arc.c   2020-04-29 23:19:26.307645579 -0700
+++ collectd.5.10.0/zfs_arc.c   2020-04-29 23:20:19.658663146 -0700
@@ -231,23 +231,6 @@
     return -1;
   }
 
-  // Ignore the first two lines because they contain information about
-  // the rest of the file.
-  // See kstat_seq_show_headers module/spl/spl-kstat.c of the spl kernel
-  // 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;

** Affects: collectd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1876135

Title:
  ARC Hit Ratio does not work in collectd zfs_arc

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/collectd/+bug/1876135/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to