Created
July 24, 2014 05:32
-
-
Save koemu/539d8307f55a21d79091 to your computer and use it in GitHub Desktop.
Get running KVM guests for Mackerel
This file contains 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
#!/bin/bash | |
DATE=$(date +%s) | |
echo -e "kvm.guest.state.running\t$(virsh list --uuid | sed '/^$/d' | wc -l)\t${DATE}" | |
echo -e "kvm.guest.state.inactive\t$(virsh list --inactive --uuid | sed '/^$/d'| wc -l)\t${DATE}" |
This file contains 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
# Please append this lines to your config file. | |
[plugin.metrics.kvm_guest_state] | |
command = "/usr/local/bin/kvm_guest_state_metrics.sh" | |
type = "metric" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment