require 'remon/metrics/yum' defcheck :yum do def init @yum = Metrics::Yum.new end def run updates_available end private def updates_available service = "yum updates" count = @yum.updates_available state = count > 0 ? "warning" : "ok" metric = state == "ok" ? 0 : 1 event({ service: service, description: "#{count} updates available", state: state, metric: metric }) rescue => e logger.error "#{e.class}: #{e.message}" warning_event service end end