ZFS Pool not discovered

Hi all,

currently i’m testing the ZFS monitoring via LibreNMS. For this i use a test server with some basic zfs pool. I followed the guide for the LibreNMS extensions here Applications - LibreNMS Docs

my pool:

sudo zpool status
  pool: data
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        data        ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdh     ONLINE       0     0     0
            sdf     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sdg     ONLINE       0     0     0
            sde     ONLINE       0     0     0

snmpd.conf

sysServices    72
master  agentx
com2sec readonly  default         xxxxxx
group MyROGroup v2c        readonly
view all    included  .1                               80
access MyROGroup ""      any       noauth    exact  all    none   none
syslocation xxxxx
syscontact xxxxxx
extend distro /usr/bin/distro
extend hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name'
extend manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor'
extend serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial'
extend zfs 'sudo /etc/snmp/zfs-linux'
extend mdadm /etc/snmp/mdadm

in the sudoers config i added this line:

snmp ALL=(ALL) NOPASSWD: /etc/snmp/zfs-linux

and i have the script in my snmp folder:

$ ls -la /etc/snmp
total 32
drwxr-xr-x   2 root root  4096 Apr  1 10:07 .
drwxr-xr-x 101 root root  4096 Apr  1 09:45 ..
-rwxr-xr-x   1 root root  3521 Apr  1 10:01 mdadm
-rw-r--r--   1 root root   510 Jun 23  2020 snmp.conf
-rw-------   1 root root  3779 Apr  1 10:07 snmpd.conf
-rwxr-xr-x   1 root root 10236 Apr  1 09:41 zfs-linux

my mdadm array is working:
2022-04-01 12_33_01-Start

but not my ZFS:
2022-04-01 12_33_34-Start

did i missed something? It auto-detects the ZFS application but no array.

EDIT:
i tried to run the script manually and my pool is present there:

{
   "deleted":0,
   "evict_skip":0,
   "mutex_skip":0,
   "recycle_miss":0,
   "arc_size":1320592,
   "target_size_max":8388562944,
   "target_size_min":524285184,
   "target_size":8388562944,
   "target_size_per":100.0,
   "arc_size_per":0.015742767966527165,
   "target_size_arat":1.0,
   "min_size_per":6.25,
   "mfu_size":4194281472,
   "p":4194281472,
   "rec_used_per":50.0,
   "freq_used_per":50.0,
   "arc_hits":9377,
   "arc_misses":0,
   "demand_data_hits":0,
   "demand_data_misses":0,
   "demand_meta_hits":9377,
   "demand_meta_misses":0,
   "mfu_ghost_hits":0,
   "mfu_hits":9186,
   "mru_ghost_hits":0,
   "mru_hits":191,
   "pre_data_hits":0,
   "pre_data_misses":0,
   "pre_meta_hits":0,
   "pre_meta_misses":0,
   "anon_hits":0,
   "arc_accesses_total":9377,
   "demand_data_total":0,
   "pre_data_total":0,
   "real_hits":9377,
   "cache_hits_per":100.0,
   "cache_miss_per":0.0,
   "actual_hit_per":100.0,
   "data_demand_per":0,
   "data_pre_per":0,
   "anon_hits_per":0,
   "mru_per":2.0368987949237494,
   "mfu_per":97.96310120507626,
   "mru_ghost_per":0.0,
   "mfu_ghost_per":0.0,
   "demand_hits_per":0.0,
   "pre_hits_per":0.0,
   "meta_hits_per":100.0,
   "pre_meta_hits_per":100.0,
   "demand_misses_per":0,
   "pre_misses_per":0,
   "meta_misses_per":0,
   "pre_meta_misses_per":0,
   "pools":[
      {
         "name":"data",
         "size":"5995774345216",
         "alloc":"285696",
         "free":"5995774059520",
         "ckpoint":0,
         "expandsz":0,
         "frag":"0",
         "cap":"0",
         "dedup":"1.00",
         "health":"ONLINE",
         "altroot":"-"
      }
   ]
}

Thank you very much
-Felix

I am also seeing this issue.

the zfs-linux script does produce JSON data that includes the pools. However, those are not returned via snmpd.

I’m debugging still.

Got it.

Here’s my “extend” line:

extend zfs /usr/bin/sudo /etc/snmp/zfs-linux
1 Like

docs pull request made:

1 Like

This was a good hint but not the full solution for me.

What I found is that the username for the snmpd in Ubuntu is “Debian-snmp” and not just “snmp”. I replaced the line “snmp ALL=(ALL) NOPASSWD: /etc/snmp/zfs-linux” in my sudoers config to “Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/zfs-linux” and it worked. Seems like “snmp” is not always the default user for the snmp process

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.