sensu-plugins-zfs 0.4.4 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/check-zpool.rb +12 -2
- data/lib/sensu-plugins-zfs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abfc1f08000c99796f34bba4905d998ec6972c79
|
4
|
+
data.tar.gz: e15141a24d419564abf7c0562c0442e845972ec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34ebaa3beb2e74711f02a6475d82514a15774b9bcc51a935d1525dadaf30c6e802cf6a271ecb62800e5eb21be6980975725185c4f6c60dba95d011978ca5ab95
|
7
|
+
data.tar.gz: 232e33e796e1857aa9cd5375f51c5ca5e36e9fb5cf88510170eec0d48b4f17a220a7bbcca3457278cbce5f279b28f68a1e0b9d698b17e673131c12dfab425d6c
|
data/bin/check-zpool.rb
CHANGED
@@ -1,11 +1,21 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'sensu-plugin/check/cli'
|
4
4
|
require 'sensu-plugins-zfs'
|
5
5
|
|
6
6
|
class CheckZPool < Sensu::Plugin::Check::CLI
|
7
|
+
option :zpool,
|
8
|
+
short: "-z ZPOOL",
|
9
|
+
long: "--zpool ZPOOL",
|
10
|
+
description: "Name of zpool to check. If omitted, we check all zpools"
|
11
|
+
|
7
12
|
def run
|
8
|
-
zpools =
|
13
|
+
zpools = []
|
14
|
+
if config[:zpool]
|
15
|
+
zoopls << SensuPluginsZFS::ZPool.new config[:zpool]
|
16
|
+
else
|
17
|
+
zpools = zpools.SensuPluginsZFS::ZFS.zpools
|
18
|
+
end
|
9
19
|
zpools.each do |zp|
|
10
20
|
check_state zp
|
11
21
|
check_vdevs zp
|