Sha256: 2b015dddef5caf8f3011778e71ad676bc2429a1b1e2730abca7e5afcc0af617e

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

require 'remon/metrics/salt'

defcheck :salt do

  def init
    @salt = Metrics::Salt.new
  end

  def run
    drift_status
  end

  private

  def drift_status
    status = @salt.status
    state = status[:state] == "ok" ? "ok" : "warning"
    metric = state == "ok" ? 0 : 1
    event({
      service: "salt",
      description: "#{status[:state]}: #{status[:ok]}/#{status[:total]}",
      state: state,
      metric: metric
    })
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
remon-0.1.0 lib/remon/checks/salt.rb