1

Initial commit

This commit is contained in:
eleksir
2018-09-23 14:24:20 +03:00
commit d6e2f9f211
9 changed files with 470 additions and 0 deletions

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";
}
}
}