Created
November 3, 2015 09:16
-
-
Save guyromm/6852f57f565fd1dd723d to your computer and use it in GitHub Desktop.
retrieve block device stats for all libvirt machines on a node
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
| #!/bin/bash | |
| IS=$(virsh list | grep -v Name | awk '{print $2}') | |
| for I in $IS ; do | |
| BLKS="$(virsh domblklist $I| egrep -v '^(Target|\-\-\-)' | awk '{print $1}')" | |
| for BLK in $BLKS ; do | |
| virsh domblkstat $I $BLK | egrep -v '^$' | sed -e 's/^/'$I' /' | |
| done | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment