summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-05-16 09:12:56 -0700
committerTim Smith <tsmith@chef.io>2017-05-16 09:12:56 -0700
commitf835ca6beafe91623b0f66ede802e3ebb98b9131 (patch)
tree8ad3de0b4ea412817efbb59314143a4fb3965616
parentc952745dd443e35cd9ef8303d7e6ce81c205937d (diff)
downloadohai-zpool.tar.gz
Support BSDzpool
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/zpools.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ohai/plugins/zpools.rb b/lib/ohai/plugins/zpools.rb
index 00313723..7e518663 100644
--- a/lib/ohai/plugins/zpools.rb
+++ b/lib/ohai/plugins/zpools.rb
@@ -47,7 +47,7 @@ Ohai.plugin(:Zpools) do
pools
end
- collect_data(:solaris2, :linux) do
+ collect_data(:solaris2, :linux, :freebsd, :openbsd, :netbsd, :dragonflybsd) do
pools = gather_pool_info
# Grab individual health for devices in the zpools
@@ -68,7 +68,8 @@ Ohai.plugin(:Zpools) do
case line
# linux: http://rubular.com/r/J3wQC6E2lH
# solaris: http://rubular.com/r/FqOBzUQQ4p
- when /^\s+((sd|c)[-_a-zA-Z0-9]+)\s+([-_a-zA-Z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)$/
+ # freebsd: http://rubular.com/r/RYkMNlytXl
+ when /^\s+((sd|c|ad|da)[-_a-zA-Z0-9]+)\s+([-_a-zA-Z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)$/
Ohai::Log.debug("Plugin Zpools: Parsing zpool status line: #{line.chomp}")
pools[pool][:devices][$1] = Mash.new
pools[pool][:devices][$1][:state] = $3