Created
July 27, 2012 04:29
-
-
Save wjimenez5271/3186181 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| 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[virsh list |grep i-|wc -l] | |
| #submit them to riemann | |
| report( | |
| :service => "KVM Running VMs", | |
| :metric => kvm_instances.to_i, | |
| :state => "info" | |
| ) | |
| end | |
| end | |
| Riemann::Tools::KVM.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment