Skip to content

Commit 98840f7

Browse files
committed
Update rbd_client_info.sh
1 parent a3b3a01 commit 98840f7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

rbd_client_info.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ convert_bytes() {
4141
fi
4242
}
4343

44-
# Get list of pools using jq
44+
# Get list of all pool names
4545
pools=$(ceph osd lspools -f json | jq -r '.[].poolname')
4646

4747
for pool in $pools; do
48+
# Check if this pool has the 'rbd' application
49+
app_list=$(ceph osd pool application get "$pool" --format json 2>/dev/null)
50+
if ! echo "$app_list" | jq -e 'has("rbd")' > /dev/null; then
51+
echo "⏩ Skipping pool '$pool' (no 'rbd' application)"
52+
continue
53+
fi
54+
4855
images=$(rbd ls "$pool")
4956

5057
for image in $images; do
@@ -67,4 +74,4 @@ for pool in $pools; do
6774
done
6875
done
6976

70-
echo "Report saved to $output_file"
77+
echo "Report saved to $output_file"

0 commit comments

Comments
 (0)