sensu-plugins / sensu-plugins-zfs

Sensu ZFS Plugin
http://sensu-plugins.io
MIT License
3 stars 12 forks source link

Fix checking all zpools (#2) #9

Closed smuth4 closed 6 years ago

smuth4 commented 6 years ago

Also re-order checks so the ones that can go critical are checked first

Before:

$ /opt/sensu/embedded/bin/check-zpool.rb
sh: tank: not found
sh: tank2: not found
sh: tank: not found
sh: tank2: not found
sh: tank: not found
sh: tank2: not found
CheckZPool CRITICAL: zpool tank3
tank
tank2 has state pool: tank3
 state: ONLINE
  scan: scrub repaired 0 in XXXXXX with 0 errors on XXXXX config:

    NAME                                            STATE     READ WRITE CKSUM
    tank3                                           ONLINE       0     0     0
      raidz2-0                                      ONLINE       0     0     0
        gptid/disk                                  ONLINE       0     0     0

After:

$ /opt/sensu/embedded/bin/check-zpool.rb
CheckZPool CRITICAL: zpool tank2 has state DEGRADED
/opt/sensu/embedded/bin/check-zpool.rb -C 1
CheckZPool CRITICAL: capacity for zpool tank1 is above 1% (currently 60%), zpool tank2 has state DEGRADED, capacity for zpool tank2 is above 1% (currently 60%), capacity for zpool tank3 is above 1% (currently 60%)

Pull Request Checklist

Is this in reference to an existing issue?

2

General

Purpose

To fix issue #2

Known Compatibility Issues

None

majormoses commented 6 years ago

We also need a testing artifact

smuth4 commented 6 years ago

Added to the description