blind-oracle / zabbix-zfs

Zabbix template & script to monitor ZFS on Linux
Mozilla Public License 2.0
30 stars 7 forks source link

ZFS JSON Error #7

Closed bcantrell427 closed 2 years ago

bcantrell427 commented 2 years ago

CentOS 7

zabbix-release-5.0-1.el7

Preprocessing failed for: Traceback (most recent call last):. File "/etc/zabbix/scripts/zfs.py", line 170, in . ...

  1. Failed: cannot extract value from json by path "$.datasets.*": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'Traceback (most recent call last): File "/etc/zabbix/scripts/zfs.py", line 170, in 'vdevs': vdev_list(vdev_errors), File "/etc/zabbix/
blind-oracle commented 2 years ago

Try running the script directly and paste here full traceback

bcantrell427 commented 2 years ago

[root@senna scripts]# pwd /etc/zabbix/scripts [root@senna scripts]# ./zfs.py Traceback (most recent call last): File "./zfs.py", line 170, in 'vdevs': vdev_list(vdev_errors), File "./zfs.py", line 106, in vdev_list return {x[0]: { File "./zfs.py", line 114, in 'errors': errors[x[0]], KeyError: '/dev/disk/by-vdev/3-23-part2'

blind-oracle commented 2 years ago

Can you run zpool status -Pp and show output?

bcantrell427 commented 2 years ago

[root@senna scripts]# zpool status -Pp pool: scratch state: ONLINE status: Some supported features are not enabled on the pool. The pool can still be used, but some features are unavailable. action: Enable all features using 'zpool upgrade'. Once this is done, the pool may no longer be accessible by software that does not support the features. See zpool-features(5) for details. scan: resilvered 85.2G in 03:17:13 with 0 errors on Tue Jan 19 18:11:40 2021 config:

    NAME                              STATE     READ WRITE CKSUM
    scratch                           ONLINE       0     0     0
      raidz2-0                        ONLINE       0     0     0
        /dev/disk/by-vdev/1-1-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-2-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-3-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-4-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-5-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-6-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-7-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-8-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-9-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/1-10-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/1-11-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/1-12-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/1-13-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/1-14-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/1-15-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/2-1-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-2-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-3-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-4-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-5-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-6-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-7-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-8-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-9-part2   ONLINE       0     0     0
        /dev/disk/by-vdev/2-10-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/2-11-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/2-12-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/2-13-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/2-14-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/2-15-part2  ONLINE       0     0     0
    cache
      /dev/disk/by-vdev/3-1-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-2-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-3-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-4-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-5-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-6-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-9-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-10-part1    ONLINE       0     0     0
      /dev/disk/by-vdev/3-11-part1    ONLINE       0     0     0
      /dev/disk/by-vdev/3-12-part1    ONLINE       0     0     0
      /dev/disk/by-vdev/3-13-part1    ONLINE       0     0     0
      /dev/disk/by-vdev/3-14-part1    ONLINE       0     0     0
      /dev/disk/by-vdev/3-15-part1    ONLINE       0     0     0
      /dev/disk/by-vdev/3-16-part1    ONLINE       0     0     0
    spares
      /dev/disk/by-vdev/3-23-part2    UNAVAIL
      /dev/disk/by-vdev/3-23-part1    AVAIL

errors: No known data errors

pool: shared state: ONLINE status: Some supported features are not enabled on the pool. The pool can still be used, but some features are unavailable. action: Enable all features using 'zpool upgrade'. Once this is done, the pool may no longer be accessible by software that does not support the features. See zpool-features(5) for details. scan: resilvered 164K in 00:00:00 with 0 errors on Wed Jul 14 11:05:11 2021 config:

    NAME                              STATE     READ WRITE CKSUM
    shared                            ONLINE       0     0     0
      raidz1-0                        ONLINE       0     0     0
        /dev/disk/by-vdev/3-17-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/3-18-part1  ONLINE       0     0     0
        /dev/disk/by-vdev/3-19-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/3-20-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/3-21-part2  ONLINE       0     0     0
        /dev/disk/by-vdev/3-22-part2  ONLINE       0     0     0
    cache
      /dev/disk/by-vdev/3-7-part1     ONLINE       0     0     0
      /dev/disk/by-vdev/3-8-part1     ONLINE       0     0     0

errors: No known data errors [root@senna scripts]#

bcantrell427 commented 2 years ago

It looks like it is hung on an old issue I had with the 45Drives config that I have. we had a hot spare issue that couldn't be removed and that's the disk its hanging on. If you have any workarounds I would appreciate them, I am also reaching out to 45 Drives to have them fix what I think is the root issue

blind-oracle commented 2 years ago

Yes, I guess that's because of hot spares, i'll try to fix

blind-oracle commented 2 years ago

I did a commit, try to run again on your setup

blind-oracle commented 2 years ago

Should work now