Last active
January 2, 2016 15:38
-
-
Save concubidated/8324399 to your computer and use it in GitHub Desktop.
Pool RBD Usage
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 | |
declare -A POOLS; | |
for pool in $(ceph osd dump|grep pool|awk -F"'" '{print $2}'); | |
do | |
for rbd in $(rbd list -p $pool 2>/dev/null); | |
do | |
if [ "$rbd" != "" ];then | |
size=$(rbd info -p $pool $rbd|grep size|awk '{print $2}'); | |
let POOLS[$pool]+="$size"; | |
fi; | |
done; | |
done; | |
for pool in "${!POOLS[@]}"; | |
do | |
for size in ${POOLS[$pool]}; | |
do | |
echo $pool: $size MB; | |
done; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment