#!/usr/bin/env ruby Process.setproctitle($0) require File.expand_path('../../lib/riemann/tools', __FILE__) class Riemann::Tools::KVM include Riemann::Tools def tick #determine how many instances I have according to libvirt kvm_instances = %x[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 Riemann::Tools::KVM.run