Last active
August 29, 2015 14:07
-
-
Save waja/9cc17eccaa1c7fd055ea to your computer and use it in GitHub Desktop.
Shell script gathering Xen DomU resources on a Dom0
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/sh | |
for DOMU in $(xm list | grep -v -E "^(Name|Domain-0)" | awk '{print $1}'); do | |
PARTSPACE=$(lvdisplay /dev/xen-vol/${DOMU}-disk | grep Size | awk '{print $3}') | |
RESOURCES=$(xm list | grep ${DOMU} | awk '{printf "%s %s %s",$6,$3,$4}') | |
# name_domu cpu_time ram vcpu part_space | |
echo ${DOMU} ${RESOURCES} ${PARTSPACE} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment