1

ceph-osd-list.pl: created.

This commit is contained in:
Sergei
2017-11-23 13:23:14 +00:00
parent 26831a639f
commit 0fcac86e0f

22
ceph-osd-list.pl Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/perl
#
use strict;
use warnings "all";
use JSON::PP;
my $jstr = `ceph osd tree --format=json`;
my $json = decode_json $jstr;
my @nodes = @{ $json->{'nodes'} };
foreach my $node (@nodes) {
if ($node->{'type'} eq 'host') {
print "Хост: $node->{'name'}\n";
my @children = @{ $node->{'children'} };
foreach my $child (@children) {
print "Диск: osd.$child\n";
}
}
}