Sha256: 248fbde5c115d3383f11abcb3b472cbc209c03e4e6fd394654beb2180f46f492
Contents?: true
Size: 970 Bytes
Versions: 13
Compression:
Stored size: 970 Bytes
Contents
# frozen_string_literal: true require 'riemann/tools' # Gathers munin statistics and submits them to Riemann. module Riemann module Tools class Munin include Riemann::Tools require 'munin-ruby' def initialize @munin = ::Munin::Node.new end def tick services = opts[:services] || @munin.list services.each do |service_name| @munin.fetch(service_name).each do |service, parts| parts.each do |part, metric| report( service: "#{service} #{part}", metric: metric.to_f, state: 'ok', tags: ['munin'], ) end end end end opt :munin_host, 'Munin hostname', default: 'localhost' opt :munin_port, 'Munin port', default: 4949 opt :services, 'Munin services to translate (if not specified, all services are relayed)', type: :strings end end end
Version data entries
13 entries across 13 versions & 1 rubygems