blind-oracle / zabbix-zfs

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

Error #8

Closed SanchesWise closed 2 years ago

SanchesWise commented 2 years ago

Hi. I have some troubles when run your script

[14:21][ccsfarm]@[/etc/zabbix/zabbix_agent2.d]
└─ $ zfs.py
Traceback (most recent call last):
  File "/usr/bin/zfs.py", line 174, in <module>
    'vdevs': vdev_list(vdev_errors),
  File "/usr/bin/zfs.py", line 110, in vdev_list
    return {x[0]: {
  File "/usr/bin/zfs.py", line 118, in <dictcomp>
    'errors': errors[x[0]],
KeyError: '/dev/disk/by-id/wwn-0x50000398c8c8b4eb-part1'

zpool list -PHvp tank01 308000694730752 276059917025280 31940777705472 - - 5 89 1.00 DEGRADED - raidz2 154000347365376 138481940914176 15518406451200 - - 6 89 - DEGRADED /dev/disk/by-id/wwn-0x50000398b8c8d14b-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399e8d313d9-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399f8c8c075-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398c8c9acea-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399f8c8ee13-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398b8c8b2ce-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398b8c8eadc-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399f8cbfb23-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398c8c8eaf1-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399f8ca7c7b-part1 - - - - - - - - ONLINE spare - - - - - - - - DEGRADED /dev/disk/by-id/wwn-0x50000398c8c808bb-part1 - - - - - - - - FAULTED /dev/disk/by-id/wwn-0x50000398b8c8d653-part1 - - - - - - - - ONLINE raidz2 154000347365376 137577976111104 16422371254272 - - 5 89 - ONLINE /dev/disk/by-id/wwn-0x50000398e8c80621-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398b8c8fdab-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399f8c9c082-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398c8c9018c-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399e8d2f9e6-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398b8c8b134-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398b8c9200a-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398c8c8b097-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000399f8cbe60b-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398b8c8fdb1-part1 - - - - - - - - ONLINE /dev/disk/by-id/wwn-0x50000398e8c80b8c-part1 - - - - - - - - ONLINE cache - - - - - - - - - /dev/disk/by-partuuid/952ab637-eea8-cb4b-99b3-22af1dc191dc 1383506640896 1257344499712 126162141184 - - 0 90 - ONLINE spare - - - - - - - - - /dev/disk/by-id/wwn-0x50000398c8c8b4eb-part1 - - - - - - - - UNAVAIL /dev/disk/by-id/wwn-0x50000398b8c8d653-part1 - - - - - - - - INUSE

SanchesWise commented 2 years ago

`zpool status -Pp pool: tank01 state: DEGRADED status: One or more devices are faulted in response to persistent errors. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Replace the faulted device, or use 'zpool clear' to mark the device repaired. scan: resilvered 10.9T in 1 days 11:05:07 with 0 errors on Mon Jan 10 11:34:02 2022 config:

    NAME                                                          STATE     READ WRITE CKSUM
    tank01                                                        DEGRADED     0     0     0
      raidz2-0                                                    DEGRADED     0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c8d14b-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399e8d313d9-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399f8c8c075-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398c8c9acea-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399f8c8ee13-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c8b2ce-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c8eadc-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399f8cbfb23-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398c8c8eaf1-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399f8ca7c7b-part1              ONLINE       0     0     0
        spare-10                                                  DEGRADED     0     0     0
          /dev/disk/by-id/wwn-0x50000398c8c808bb-part1            FAULTED    136     0     0  too many errors
          /dev/disk/by-id/wwn-0x50000398b8c8d653-part1            ONLINE       0     0     0
      raidz2-1                                                    ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398e8c80621-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c8fdab-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399f8c9c082-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398c8c9018c-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399e8d2f9e6-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c8b134-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c9200a-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398c8c8b097-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000399f8cbe60b-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398b8c8fdb1-part1              ONLINE       0     0     0
        /dev/disk/by-id/wwn-0x50000398e8c80b8c-part1              ONLINE       0     0     0
    cache
      /dev/disk/by-partuuid/952ab637-eea8-cb4b-99b3-22af1dc191dc  ONLINE       0     0     0
    spares
      /dev/disk/by-id/wwn-0x50000398c8c8b4eb-part1                UNAVAIL 
      /dev/disk/by-id/wwn-0x50000398b8c8d653-part1                INUSE     currently in use

errors: No known data errors`

blind-oracle commented 2 years ago

Merged the PR, should be OK for now, will think more later :)