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