Sha256: c191f163a9d6075a39179f9ff0727af4cebc95c89040c8ee85cb09ce0560d0ff
Contents?: true
Size: 862 Bytes
Versions: 12
Compression:
Stored size: 862 Bytes
Contents
# frozen_string_literal: true require 'open3' require 'riemann/tools' module Riemann module Tools class Zpool include Riemann::Tools def tick output, status = Open3.capture2e('zpool status -x') state = if status.success? case output when "all pools are healthy\n" then 'ok' when /state: (DEGRADED|FAULTED)/ then 'critical' else 'warning' end else 'critical' end report( service: 'zpool health', description: output, state: state, ) rescue Errno::ENOENT => e report( service: 'zpool health', description: e.message, state: 'critical', ) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems