Sha256: 6a0cf5fb530dd8e8ce5d0bfa3fb64954f3ee9ea6e2e8e82ce1bdcf359cec6f6a

Contents?: true

Size: 463 Bytes

Versions: 14

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

require 'riemann/tools'

module Riemann
  module Tools
    class Kvm
      include Riemann::Tools

      def tick
        # determine how many instances I have according to libvirt
        kvm_instances = `LANG=C virsh list | grep -c running`

        # submit them to riemann
        report(
          service: 'KVM Running VMs',
          metric: kvm_instances.to_i,
          state: 'info',
        )
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
riemann-tools-1.11.0 lib/riemann/tools/kvm.rb
riemann-tools-1.10.0 lib/riemann/tools/kvm.rb
riemann-tools-1.9.1 lib/riemann/tools/kvm.rb
riemann-tools-1.9.0 lib/riemann/tools/kvm.rb
riemann-tools-1.8.2 lib/riemann/tools/kvm.rb
riemann-tools-1.8.1 lib/riemann/tools/kvm.rb
riemann-tools-1.8.0 lib/riemann/tools/kvm.rb
riemann-tools-1.7.1 lib/riemann/tools/kvm.rb
riemann-tools-1.7.0 lib/riemann/tools/kvm.rb
riemann-tools-1.6.0 lib/riemann/tools/kvm.rb
riemann-tools-1.5.0 lib/riemann/tools/kvm.rb
riemann-tools-1.4.0 lib/riemann/tools/kvm.rb
riemann-tools-1.3.0 lib/riemann/tools/kvm.rb
riemann-tools-1.2.0 lib/riemann/tools/kvm.rb