Created
July 25, 2012 00:01
-
-
Save wjimenez5271/3173526 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
| require 'riemann/client' | |
| c = Riemann::Client.new host: 'euca-riemann', port: 5555 | |
| #find out my hostname | |
| host = %x[hostname] | |
| #first determine how many instances I have according to libvirt | |
| kvm_instances = %x[virsh list |grep i-|wc -l] | |
| #write it out to the console for now just to make sure I've got what I am expecting | |
| puts kvm_instances.to_i | |
| # then sends it ro riemann | |
| c << {host: host, service: 'KVM', state: 'info', description: 'Number of KVM virtual machines currently running', metric: kvm_instances.to_i,} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment